[Zope-Checkins] CVS: Zope/lib/python/Products/ZCatalog/help - ZCatalog.py:1.14.6.1
Casey Duncan
casey@zope.com
Tue, 10 Dec 2002 10:55:01 -0500
Update of /cvs-repository/Zope/lib/python/Products/ZCatalog/help
In directory cvs.zope.org:/tmp/cvs-serv31233/lib/python/Products/ZCatalog/help
Modified Files:
Tag: Zope-2_6-branch
ZCatalog.py
Log Message:
Backport catalog sort speedups from the HEAD sans ZCatalog and PlugInIndex API changes
=== Zope/lib/python/Products/ZCatalog/help/ZCatalog.py 1.14 => 1.14.6.1 ===
--- Zope/lib/python/Products/ZCatalog/help/ZCatalog.py:1.14 Wed Aug 14 18:25:15 2002
+++ Zope/lib/python/Products/ZCatalog/help/ZCatalog.py Tue Dec 10 10:55:00 2002
@@ -178,6 +178,10 @@
sort_order -- You can specify 'reverse' or 'descending'.
Default behavior is to sort ascending.
+
+ sort_limit -- An optimization hint to tell the catalog how many
+ results you are really interested in. See the limit argument
+ to the search method for more details.
There are some rules to consider when querying this method:
@@ -210,4 +214,27 @@
def __call__(REQUEST=None, **kw):
"""
Search the catalog, the same way as 'searchResults'.
+ """
+
+ def search(query_request, sort_index=None, reverse=0, limit=None, merge=1):
+ """Programmatic search interface, use for searching the catalog from
+ scripts.
+
+ query_request -- Dictionary containing catalog query. This uses the
+ same format as searchResults.
+
+ sort_index -- Name of sort index
+
+ reverse -- Boolean, reverse sort order (defaults to false)
+
+ limit -- Limit sorted result count to the n best records. This is an
+ optimization hint used in conjunction with a sort_index. If possible
+ ZCatalog will use a different sort algorithm that uses much less memory
+ and scales better then a full sort. The actual number of records
+ returned is not guaranteed to be <= limit. You still need to apply the
+ same batching to the results.
+
+ merge -- Return merged, lazy results (like searchResults) or raw
+ results for later merging. This can be used to perform multiple
+ queries (even across catalogs) and merge and sort the combined results.
"""