[Zope] Proximity searches w/ ZCatalog

Dieter Maurer dieter@handshake.de
Wed, 10 Jan 2001 23:41:25 +0100 (CET)


Chris Withers writes:
 > sean.upton@uniontrib.com wrote:
 > > 
 > > Supposedly proximity searches are possible... like "FIDELITY within 8 words
 > > of MUTUAL FUNDS."  Can't find anything in docs.  Anybody have a suggestion
 > > here...
 > 
 > Yeah, I think you'd put "FIDELITY ... MUTUAL FUNDS" in the search box.
 > 
 > I think Dieter Maurer <dieter@handshake.de> wrote the code, so he's
 > probably a good person to speak to :-)
No, I just looked for bugs in it and found several.

It is almost as you described:

  the proximity operator is "..."

  you can not control the distance

  "..." is effectively an "and" with a high score when the
    terms are near together and a lower score for higher
    distances

  term in "..." are effectively combined with "...",
    thus: '"bear wine champagner"' is equivalent to
    'bear ... wine ... champagner'


ZCatalog would interpret "FIDELITY ... MUTUAL FUNDS"
as "(FIDELITY ... MUTUAL) or FUNDS"
The nearest result what "sean" asked for, would
probably be 'FIDELITY ... "MUTUAL FUNDS"',
which is equivalent to 'FIDELITY ... (MUTUAL ... FUNDS)'.

I have not too much confidence in ZCatalog (yet ; this
may change now that Chris P is responsible for it).
I doubt, it will implement "A ... B ... C"
sensefully.
It is a big question, all together, whether a binary
operator is the correct choice for proximity.



Dieter