Skip to content

Commit

Permalink
Merge 1e05716 into 4066d07
Browse files Browse the repository at this point in the history
  • Loading branch information
razvanMiu committed Mar 26, 2024
2 parents 4066d07 + 1e05716 commit 8ff84b1
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/Products/ZCatalog/Catalog.py
Expand Up @@ -587,8 +587,9 @@ def _search_index(self, cr, index_id, query, rs):

return rs

def search(self, query,
sort_index=None, reverse=False, limit=None, merge=True):
def search(
self, query, sort_index=None, reverse=False, limit=None,
merge=True, rids=False):
"""Iterate through the indexes, applying the query to each one. If
merge is true then return a lazy result set (sorted if appropriate)
otherwise return the raw (possibly scored) results for later merging.
Expand Down Expand Up @@ -634,6 +635,10 @@ def search(self, query,
cr.stop()
return result

if rids:
cr.stop()
return rs

# Try to deduce the sort limit from batching arguments.
b_start, b_size, limit, sort_report_name = self._sort_limit_arguments(
query, sort_index, reverse, limit)
Expand Down Expand Up @@ -1061,7 +1066,7 @@ def _getSortIndex(self, args):
return sort_indexes
return None

def searchResults(self, query=None, _merge=True, **kw):
def searchResults(self, query=None, _merge=True, rids=False, **kw):
# You should pass in a simple dictionary as the first argument,
# which only contains the relevant query.
query = self.merge_query_args(query, **kw)
Expand All @@ -1081,7 +1086,8 @@ def searchResults(self, query=None, _merge=True, **kw):
# be nice and keep the old API intact for single sort_order
reverse = reverse[0]
# Perform searches with indexes and sort_index
return self.search(query, sort_indexes, reverse, sort_limit, _merge)
return self.search(
query, sort_indexes, reverse, sort_limit, _merge, rids)

__call__ = searchResults

Expand Down

0 comments on commit 8ff84b1

Please sign in to comment.