[Zope-Checkins] CVS: Zope2 - UnTextIndex.py:1.43

Jim Fulton jim@digicool.com
Wed, 21 Mar 2001 17:05:05 -0500 (EST)


Update of /cvs-repository/Zope2/lib/python/SearchIndex
In directory korak:/tmp/cvs-serv14104

Modified Files:
	UnTextIndex.py 
Log Message:
The positions method is broken, and always has been, at it
depends on a pre-catalog architecture and the post-catalog
architecture isn't fully cooked. To get positions, we need to either
store the positions during indexing, which is way too expensive, or we
need to be able to get to the original text when searching, which we
can't do. 

For now we'll return something bogus, which will make 'near' searches
behave effectively as 'and' searches.


--- Updated File UnTextIndex.py in package Zope2 --
--- UnTextIndex.py	2001/03/21 15:25:51	1.42
+++ UnTextIndex.py	2001/03/21 22:05:04	1.43
@@ -505,9 +505,18 @@
         return (IIBucket(), (self.id,))
 
 
-    def positions(self, docid, words, obj):
+    def positions(self, docid, words,
+                  # This was never tested: obj
+                  ):
         """Return the positions in the document for the given document
         id of the word, word."""
+
+        return [1]
+
+        #################################################################
+        # The code below here is broken and requires an API change to fix
+        # it. Waaaaa.
+
 
         if self._schema is None:
             f = getattr