From f944408e696781efc2e30d93806df83fb999edb9 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Tue, 28 Feb 2023 19:18:04 -0600 Subject: [PATCH] Update content_config pytest fixture to index plugin content --- tests/conftest.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/conftest.py b/tests/conftest.py index a5963eaf..5da27bbb 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -14,6 +14,7 @@ from khoj.utils.rawconfig import ( TextSearchConfig, ImageSearchConfig, ) +from khoj.processor.jsonl.jsonl_to_jsonl import JsonlToJsonl from khoj.processor.org_mode.org_to_jsonl import OrgToJsonl from khoj.search_filter.date_filter import DateFilter from khoj.search_filter.word_filter import WordFilter @@ -64,13 +65,27 @@ def content_config(tmp_path_factory, search_config: SearchConfig): content_config.org = TextContentConfig( input_files=None, input_filter=["tests/data/org/*.org"], - compressed_jsonl=content_dir.joinpath("notes.jsonl.gz"), + compressed_jsonl=content_dir.joinpath("notes.jsonl"), embeddings_file=content_dir.joinpath("note_embeddings.pt"), ) filters = [DateFilter(), WordFilter(), FileFilter()] text_search.setup(OrgToJsonl, content_config.org, search_config.asymmetric, regenerate=False, filters=filters) + content_config.plugins = { + "plugin1": TextContentConfig( + input_files=[content_dir.joinpath("notes.jsonl")], + input_filter=None, + compressed_jsonl=content_dir.joinpath("plugin.jsonl.gz"), + embeddings_file=content_dir.joinpath("plugin_embeddings.pt"), + ) + } + + filters = [DateFilter(), WordFilter(), FileFilter()] + text_search.setup( + JsonlToJsonl, content_config.plugins["plugin1"], search_config.asymmetric, regenerate=False, filters=filters + ) + return content_config