diff --git a/frappe/search/full_text_search.py b/frappe/search/full_text_search.py index ebe9390c38..23759ab785 100644 --- a/frappe/search/full_text_search.py +++ b/frappe/search/full_text_search.py @@ -23,6 +23,9 @@ class FullTextSearch: def get_schema(self): return Schema(name=ID(stored=True), content=TEXT(stored=True)) + def get_fields_to_search(self): + return ["name", "content"] + def get_id(self): return "name" @@ -121,7 +124,7 @@ class FullTextSearch: out = [] with ix.searcher() as searcher: - parser = MultifieldParser(["title", "content"], ix.schema, termclass=FuzzyTermExtended) + parser = MultifieldParser(self.get_fields_to_search(), ix.schema, termclass=FuzzyTermExtended) parser.remove_plugin_class(FieldsPlugin) parser.remove_plugin_class(WildcardPlugin) query = parser.parse(text) diff --git a/frappe/search/website_search.py b/frappe/search/website_search.py index 0bc06d1a9b..30eadae6f1 100644 --- a/frappe/search/website_search.py +++ b/frappe/search/website_search.py @@ -21,6 +21,9 @@ class WebsiteSearch(FullTextSearch): title=TEXT(stored=True), path=ID(stored=True), content=TEXT(stored=True) ) + def get_fields_to_search(self): + return ["title", "content"] + def get_id(self): return "path"