Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
d50be848
Commit
d50be848
authored
Jun 09, 2003
by
Sidnei da Silva
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updating interfaces at Shane's request, plus some whitespace cleaning
parent
148fd61b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
18 deletions
+24
-18
lib/python/Products/ZCatalog/IZCatalog.py
lib/python/Products/ZCatalog/IZCatalog.py
+16
-10
lib/python/Products/ZCatalog/ZCatalog.py
lib/python/Products/ZCatalog/ZCatalog.py
+8
-8
No files found.
lib/python/Products/ZCatalog/IZCatalog.py
View file @
d50be848
...
...
@@ -12,7 +12,7 @@
#
##############################################################################
"""
$Id: IZCatalog.py,v 1.
5 2002/12/05 21:17:05 caseman
Exp $
$Id: IZCatalog.py,v 1.
6 2003/06/09 20:02:48 sidnei
Exp $
"""
from
Interface
import
Interface
...
...
@@ -161,7 +161,7 @@ class IZCatalog(Interface):
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 @@ class IZCatalog(Interface):
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__
lib/python/Products/ZCatalog/ZCatalog.py
View file @
d50be848
...
...
@@ -135,13 +135,13 @@ class ZCatalog(Folder, Persistent, Implicit):
(
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 @@ class ZCatalog(Folder, Persistent, Implicit):
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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment