[Zope-Checkins] CVS: Zope/lib/python/Products/ZCatalog - IZCatalog.py:1.6 ZCatalog.py:1.126
Sidnei da Silva
sidnei@x3ng.com.br
Mon, 9 Jun 2003 16:02:48 -0400
Update of /cvs-repository/Zope/lib/python/Products/ZCatalog
In directory cvs.zope.org:/tmp/cvs-serv7614
Modified Files:
IZCatalog.py ZCatalog.py
Log Message:
Updating interfaces at Shane's request, plus some whitespace cleaning
=== Zope/lib/python/Products/ZCatalog/IZCatalog.py 1.5 => 1.6 ===
--- Zope/lib/python/Products/ZCatalog/IZCatalog.py:1.5 Thu Dec 5 16:17:05 2002
+++ Zope/lib/python/Products/ZCatalog/IZCatalog.py Mon Jun 9 16:02:48 2003
@@ -161,7 +161,7 @@
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.
@@ -196,30 +196,36 @@
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
+
+ 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. Since the len() of the results will no
+ same batching to the results. Since the len() of the results will no
longer be the actual result count, you can use the
"actual_result_count" attribute of the lazy result object instead to
determine the size of the full result set.
- merge -- Return merged, lazy results (like searchResults) or raw
+ 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.
"""
+
+ def refreshCatalog():
+ """Reindex every object we can find, removing the unreachable
+ ones from the index.
+ """
+
__doc__ = IZCatalog.__doc__ + __doc__
=== Zope/lib/python/Products/ZCatalog/ZCatalog.py 1.125 => 1.126 ===
--- Zope/lib/python/Products/ZCatalog/ZCatalog.py:1.125 Mon Mar 3 13:15:18 2003
+++ Zope/lib/python/Products/ZCatalog/ZCatalog.py Mon Jun 9 16:02:48 2003
@@ -135,13 +135,13 @@
(search_zcatalog,
['searchResults', '__call__', 'uniqueValuesFor',
- 'getpath', 'schema', 'indexes', 'index_objects',
+ 'getpath', 'schema', 'indexes', 'index_objects',
'all_meta_types', 'valid_roles', 'resolve_url',
'getobject', 'search'],
['Anonymous', 'Manager']),
-
- (manage_zcatalog_indexes,
- ['getIndexObjects'],
+
+ (manage_zcatalog_indexes,
+ ['getIndexObjects'],
['Manager']),
)
@@ -614,24 +614,24 @@
Search terms can be passed in the REQUEST or as keyword
arguments.
-
+
The used argument is now deprecated and ignored
"""
return self._catalog.searchResults(REQUEST, used, **kw)
__call__=searchResults
-
+
def search(
self, 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
sort_index: Name of sort index
reverse: Reverse sort order?
limit: Limit sorted result count (optimization hint)
- merge: Return merged results (like searchResults) or raw
+ merge: Return merged results (like searchResults) or raw
results for later merging.
"""
if sort_index is not None: