[Zope3-checkins] CVS: Zope3/src/zope/app/index - adapters.py:1.1 configure.zcml:1.5

Anthony Baxter anthony@interlink.com.au
Sun, 13 Jul 2003 04:23:45 -0400


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

Modified Files:
	configure.zcml 
Added Files:
	adapters.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).


=== Added File Zope3/src/zope/app/index/adapters.py ===
from zope.index.interfaces.index import IQuerying, ISimpleQuery


class SimpleQuery:
    "Call an IQuerying search, return only the hubids"
    __used_for__ = IQuerying

    def __init__(self, index):
        self._index = index

    def query(self, term, start=0, count=None):
        reslist, count = self._index.query(term, start, count)
        reslist = [ x[0] for x in reslist ]
        return reslist


=== Zope3/src/zope/app/index/configure.zcml 1.4 => 1.5 ===
--- Zope3/src/zope/app/index/configure.zcml:1.4	Fri Jul 11 01:50:33 2003
+++ Zope3/src/zope/app/index/configure.zcml	Sun Jul 13 04:23:10 2003
@@ -3,4 +3,12 @@
   <include package=".text" />
   <include package=".field" />
 
+<adapter
+  factory=".adapters.SimpleQuery"
+  provides="zope.index.interfaces.index.ISimpleQuery"
+  for="zope.index.interfaces.index.IQuerying"
+  permission="zope.Public"
+/>
+
+
 </zopeConfigure>