Skip to content

Commit

Permalink
Ignore non-existing indexes in custom ranking
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk committed Aug 28, 2023
1 parent 7a47ece commit 1ee538b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/redturtle/volto/restapi/services/search/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def is_advanced_query(self, query):
# XXX: sarebbe meglio una monkeypatch a catalog.searchResults ? eviterebbe di
# riportare tutto il codice di search qui
def search(self, query=None):
original_query = self.request.form.copy()
query = self.request.form.copy()
query = unflatten_dotted_dict(query)
if self.is_advanced_query(query):
if "fullobjects" in query:
Expand Down Expand Up @@ -97,6 +97,8 @@ def search(self, query=None):
logger.warning(
f"Unsupported query parameter: {key} {index_type} {value}. Fall back to the standard query."
)
query = self.request.form.copy()
query = unflatten_dotted_dict(query)
return super(SearchHandler, self).search(query)

# term = query.pop("SearchableText")
Expand All @@ -121,8 +123,7 @@ def search(self, query=None):
)

return results
else:
return super(SearchHandler, self).search(query)
return super(SearchHandler, self).search(query)

def _parse_query(self, query):
query = super()._parse_query(query)
Expand Down

0 comments on commit 1ee538b

Please sign in to comment.