[Zope-dev] [Ann] Zope 2.1.6 ZCatalog patches: "and not", "near"

Dieter Maurer dieter@handshake.de
Fri, 9 Jun 2000 21:00:24 +0200 (CEST)


Michel Pelletier writes:
 > Dieter Maurer wrote:
 > > "near" searches do not work.
 > > ....
 > > The patch at
 > > 
 > >   URL:http://www.handshake.de/~dieter/pyprojects/zope/near.pat
 > > 
 > > enables "near" searches. ....
 > This isn't why I don't want to apply this patch, but rather I think it
 > would be better to specialize TextIndex instead of modifying the
 > existing one and create a new type of index, like a PositionalTextIndex,
 > that works like a text index but uses your patches.
I think, you should do something with the *existing* index.
It cruelly fails for "near" searches (returns no hits).

This probably is no problem for explicit use of the
near operator "...", because it is unlikely that someone will
use it.

However, phrase searches in the form "a b" are mapped to
"near" searches and phrase searches are quite common.

Maybe, the existing index should approximate "..." by "and".


For the time being, I am quite happy with my patch.
At a later time, I may perhaps implement a true positional
index, i.e. the word positions are compacted and stored
in an IISBTree (Int x Int -> String) such that during
search the document need not to be accessed.
Such a thing would rightfully get a special name such
as "PositionalTextIndex".


Dieter