[Zope3-checkins] CVS: Zope3/src/zope/app/catalog - catalog.py:1.4

Anthony Baxter anthony@interlink.com.au
Sun, 13 Jul 2003 01:54:01 -0400


Update of /cvs-repository/Zope3/src/zope/app/catalog
In directory cvs.zope.org:/tmp/cvs-serv24984

Modified Files:
	catalog.py 
Log Message:
Use the newly-refactored zope.index.interfaces.index.IQuerying for the
basic searchResults method. Now searching across textindexes should "just 
work".


=== Zope3/src/zope/app/catalog/catalog.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/catalog/catalog.py:1.3	Sun Jul 13 00:08:19 2003
+++ Zope3/src/zope/app/catalog/catalog.py	Sun Jul 13 01:53:57 2003
@@ -4,7 +4,7 @@
 from persistence.dict import PersistentDict
 from zope.interface import implements
 from zope.context import ContextMethod
-from zope.app.zapi import getService
+from zope.app.zapi import getService, getAdapter
 from zope.app.services.servicenames import HubIds
 from zope.exceptions import NotFoundError
 from zope.app.interfaces.services.registration import IRegisterable
@@ -14,6 +14,7 @@
 
 from zope.app.interfaces.container import IDeleteNotifiable, IAddNotifiable
 from zope.app.interfaces.container import IContainer
+from zope.index.interfaces.index import IQuerying
 
 from zope.app.container.sample import SampleContainer
 
@@ -127,7 +128,8 @@
             index = wrapped_self.get(key)
             if not index: 
                 raise ValueError, "no such index %s"%(key)
-            results = index.search(value)
+            index = getAdapter(index, IQuerying)
+            results = index.query(value)
             if pendingResults is None:
                 pendingResults = results
             else: