[Zope] ZCTextIndex - prefix wildcards not supported?

Dieter Maurer dieter at handshake.de
Sat Nov 22 12:58:48 EST 2003


Andreas Jung wrote at 2003-11-22 09:07 +0100:
 > > Dieter Maurer wrote:
 > > ...
 > > The standard way to support so called "left truncation" is to build
 > > a mapping "R" "s.reverse() --> s" for each word "s" in your index.
 > > With this map, "left truncation" can be mapped to "right truncation"
 > > as you use your reversed pattern to scan through "R"s keys.
 > >
 > > This still does not support truncation on both sides: to make this
 > > efficiently, you need sub-word indexes.
 > 
 > Truncation can be achived very easily by performing a range search
 > on BTrees....very evil but it works!.

For patterns of the form "*subword*" (I spoke about
truncation on both sides) there is no initial range to retrict the search
to (that's why it is inefficient ;-)).
Neither is for patterns of the form "*subword" unless you have
the "reverse" mapping, I mentioned above.

-- 
Dieter



More information about the Zope mailing list