Wrap words in quotes to trigger explicit filter from query

- Do not run the more expensive explicit filter until the word to be
  filtered is completed by user. This requires an end sequence marker
  to identify end of explicit word filter to trigger filtering

- Space isn't a good enough delimiter as the explicit filter could be
  at the end of the query in which case no space
This commit is contained in:
Debanjum Singh Solanky
2022-09-04 02:12:56 +03:00
parent 8d9f507df3
commit cdcee89ae5
3 changed files with 7 additions and 7 deletions

View File

@@ -133,7 +133,7 @@ def test_notes_search(content_config: ContentConfig, search_config: SearchConfig
def test_notes_search_with_include_filter(content_config: ContentConfig, search_config: SearchConfig):
# Arrange
model.orgmode_search = text_search.setup(org_to_jsonl, content_config.org, search_config.asymmetric, SearchType.Org, regenerate=False)
user_query = "How to git install application? +Emacs"
user_query = 'How to git install application? +"Emacs"'
# Act
response = client.get(f"/search?q={user_query}&n=1&t=org")
@@ -149,7 +149,7 @@ def test_notes_search_with_include_filter(content_config: ContentConfig, search_
def test_notes_search_with_exclude_filter(content_config: ContentConfig, search_config: SearchConfig):
# Arrange
model.orgmode_search = text_search.setup(org_to_jsonl, content_config.org, search_config.asymmetric, SearchType.Org, regenerate=False)
user_query = "How to git install application? -clone"
user_query = 'How to git install application? -"clone"'
# Act
response = client.get(f"/search?q={user_query}&n=1&t=org")