return query_type from SearchParser

This commit is contained in:
simon 2022-07-20 16:10:57 +07:00
parent 6a6665bdf9
commit 242ca19586
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
1 changed files with 3 additions and 3 deletions

View File

@ -146,12 +146,12 @@ class SearchForm:
def multi_search(self, search_query):
"""searching through index"""
path, query = SearchParser(search_query).run()
path, query, query_type = SearchParser(search_query).run()
look_up = SearchHandler(path, config=self.CONFIG, data=query)
search_results = look_up.get_data()
all_results = self.build_results(search_results)
return {"results": all_results}
return {"results": all_results, "queryType": query_type}
@staticmethod
def build_results(search_results):
@ -195,7 +195,7 @@ class SearchParser:
path, query = QueryBuilder(self.query_map, query_type).run()
return path, query
return path, query, query_type
def _find_map(self):
"""find query in keyword map"""