Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Configuration Flag to Index Entries with Empty Body #87

Closed
debanjum opened this issue Sep 10, 2022 · 3 comments · Fixed by #90
Closed

Add Configuration Flag to Index Entries with Empty Body #87

debanjum opened this issue Sep 10, 2022 · 3 comments · Fixed by #90
Labels
upgrade New feature or request

Comments

@debanjum
Copy link
Member

  • Currently entries with only headings and no body are not indexed
  • Once we do start to index entries with no body, a filter to exclude such entries would be preferable
  • This will increase the flexibility of khoj to work for more use-cases

See the discussion on #83 for more details

@debanjum debanjum added the upgrade New feature or request label Sep 10, 2022
@emacsomancer
Copy link

This seems to work, but the ability to index these entries is highly desirable.

@debanjum debanjum changed the title Add Filter to Exclude Entries with no Body Add Configuration Flag to Index Entries with Empty Body Sep 11, 2022
@debanjum
Copy link
Member Author

Updating issue to use a configuration flag to set via khoj.yml to allow indexing entries with empty bodies. This seems like a cleaner solution than using a query time filter which would require user input on every query and needlessly increase indexing load

debanjum added a commit that referenced this issue Sep 11, 2022
### Summary
- Set `index_heading_entries` field in `~/.khoj/khoj.yml` to `true` to index entries with empty body

### Main Changes
#### Make Indexing Org-Mode Entries with Empty Body Configurable
- 253c9ea Set `index_heading_entries` field in `khoj.yml` to index entries with no body

### Fix, Improve OrgNode, TextToJsonl Parser
- 9d369ae Fix `OrgNode` render of entries with property drawers and empty body
- 1d3b3d5 Convert field get/set methods in `OrgNode` class to `@property`
- db37e38 Create `OrgNode` `hasBody` method. Use it in `org_to_jsonl` checks
- b4878d7 Extract entries from scratch when regenerate requested
- 52e3dd9 Pass the whole `TextContentConfig` as argument to `text_to_jsonl` methods
- e951ba3 Raise exception when org file not found

Resolves #87
@debanjum
Copy link
Member Author

debanjum commented Sep 11, 2022

@emacsomancer you should now be able to index entries with an empty body. You'll need to set index_heading_entries field to true in your ~/.khoj/khoj yml. Sample screenshot shared below for reference. Let me know if it doesn't work for you
Set index_heading_entries field to true in khoj yml

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upgrade New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants