Commit c4a16d38 authored by Jim Fulton's avatar Jim Fulton

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.
parent 693013c9
......@@ -91,7 +91,7 @@ undo information so that objects can be unindexed when the old value
is no longer known.
"""
__version__ = '$Revision: 1.42 $'[11:-2]
__version__ = '$Revision: 1.43 $'[11:-2]
import string, regex, regsub, ts_regex
......@@ -505,10 +505,19 @@ class UnTextIndex(Persistent, Implicit):
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
else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment