diff --git a/src/Products/ZCatalog/Catalog.py b/src/Products/ZCatalog/Catalog.py index 95c893d5..6db61c3e 100644 --- a/src/Products/ZCatalog/Catalog.py +++ b/src/Products/ZCatalog/Catalog.py @@ -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. @@ -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) @@ -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) @@ -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