[Zope3-checkins] CVS: Zope3/src/zope/app/index/text - configure.zcml:1.8 index.py:1.12
Anthony Baxter
anthony@interlink.com.au
Sun, 13 Jul 2003 04:23:51 -0400
Update of /cvs-repository/Zope3/src/zope/app/index/text
In directory cvs.zope.org:/tmp/cvs-serv16578/app/index/text
Modified Files:
configure.zcml index.py
Log Message:
Hooked up full text indexing. There's a new interface ISimpleQuery that
accepts a term and returns a list of hubids. A simple adapter is installed
to adapt textindex to this interface. FieldIndex actually implements this
interface, rather than IQuerying (oops).
=== Zope3/src/zope/app/index/text/configure.zcml 1.7 => 1.8 ===
--- Zope3/src/zope/app/index/text/configure.zcml:1.7 Sun Jul 13 01:50:58 2003
+++ Zope3/src/zope/app/index/text/configure.zcml Sun Jul 13 04:23:16 2003
@@ -18,6 +18,25 @@
</content>
+<content class="zope.app.index.text.index.TextCatalogIndex">
+
+ <require
+ permission="zope.ManageServices"
+ interface="zope.app.interfaces.index.text.IUITextCatalogIndex"
+ attributes="query"
+ />
+
+ <factory
+ id="zope.app.index.text.TextCatalogIndex"
+ permission="zope.ManageServices"
+ />
+ <implements
+ interface="zope.app.interfaces.services.query.IQueryProcessable"
+ />
+
+</content>
+
+
<adapter
factory="zope.app.index.text.processors.BatchedRankedProcessor"
provides="zope.app.interfaces.services.query.IQueryProcessor"
=== Zope3/src/zope/app/index/text/index.py 1.11 => 1.12 ===
--- Zope3/src/zope/app/index/text/index.py:1.11 Sat Jun 7 02:37:27 2003
+++ Zope3/src/zope/app/index/text/index.py Sun Jul 13 04:23:16 2003
@@ -33,12 +33,12 @@
IObjectUnregisteredHubEvent, \
IObjectModifiedHubEvent
from zope.app.interfaces.index.text import ISearchableText
-from zope.app.interfaces.index.text import IUITextIndex
+from zope.app.interfaces.index.text import IUITextIndex, IUITextCatalogIndex
from zope.interface import implements
-class TextIndex(TextIndexWrapper):
+class TextCatalogIndex(TextIndexWrapper):
- implements(ISubscriber, IUITextIndex)
+ implements(ISubscriber, IUITextCatalogIndex)
def notify(wrapped_self, event):
"""An event occurred. Index or unindex the object in response."""
@@ -55,12 +55,17 @@
notify = ContextMethod(notify)
def _getTexts(wrapped_self, object):
+ print "Getting ISearchableText interface for object " + str(object)
adapted = queryAdapter(object, ISearchableText, context=wrapped_self)
if adapted is None:
return None
return adapted.getSearchableText()
_getTexts = ContextMethod(_getTexts)
+class TextIndex(TextCatalogIndex):
+
+ implements(IUITextIndex)
+
currentlySubscribed = False # Default subscription state
def subscribe(wrapped_self, channel=None, update=True):
@@ -98,3 +103,4 @@
if texts is not None:
wrapped_self.index_doc(hubid, texts)
_update = ContextMethod(_update)
+