Allow recursive glob pattern (**) to add files to search index

- Simplify configuring files to index For Obsidian/Org-Roam type
  systems with lots of small files in khoj.yml using `input-filter'
This commit is contained in:
Debanjum Singh Solanky 2023-01-03 01:32:58 -03:00
parent 152e5f1661
commit 52664dd96c
3 changed files with 3 additions and 3 deletions

View file

@ -77,7 +77,7 @@ class BeancountToJsonl(TextToJsonl):
filtered_beancount_files = {
filtered_file
for beancount_file_filter in beancount_file_filters
for filtered_file in glob.glob(get_absolute_path(beancount_file_filter))
for filtered_file in glob.glob(get_absolute_path(beancount_file_filter), recursive=True)
}
all_beancount_files = sorted(absolute_beancount_files | filtered_beancount_files)

View file

@ -75,7 +75,7 @@ class MarkdownToJsonl(TextToJsonl):
filtered_markdown_files = {
filtered_file
for markdown_file_filter in markdown_file_filters
for filtered_file in glob.glob(get_absolute_path(markdown_file_filter))
for filtered_file in glob.glob(get_absolute_path(markdown_file_filter), recursive=True)
}
all_markdown_files = sorted(absolute_markdown_files | filtered_markdown_files)

View file

@ -83,7 +83,7 @@ class OrgToJsonl(TextToJsonl):
filtered_org_files = {
filtered_file
for org_file_filter in org_file_filters
for filtered_file in glob.glob(get_absolute_path(org_file_filter))
for filtered_file in glob.glob(get_absolute_path(org_file_filter), recursive=True)
}
all_org_files = sorted(absolute_org_files | filtered_org_files)