[Zope-dev] ZCatalog phrase indexing revisited

Chris McDonough chrism@digicool.com
Thu, 29 Mar 2001 10:52:13 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_004E_01C0B83E.50132910
Content-Type: text/plain;
	charset="windows-1255"
Content-Transfer-Encoding: quoted-printable

Quoted phrase searching doesn't really work.  Well, it does, but not the =
way you'd expect.  Zope versions below 2.3.1b2 (all the way down to =
2.2.1 AFAICT) used to choke and error out on quoted-phrase searching.  =
But quoted-phrase searching in Zopes past 2.3.1b2 is essentially turned =
into an "AND" query instead of erroring out.  So if you do "foo bar", =
it's roughly equivalent to "foo AND bar".

This of course isn't what most people expect, but the machinery for NEAR =
searching in the catalog was used by the quoting operator (e.g. "foo =
bar" would become "foo NEAR bar").  Unfortunately, the NEAR searching =
machinery *never* worked (and still doesnt), so we had to turn the NEAR =
into an AND to get a reasonable, if misleading, result.  Hopefully we =
can graft on real NEAR searching in the future.  For now, I think "foo =
AND bar" is about as close as you're going to get to phrase searching =
without post-filtering results.

----- Original Message -----=20
From: "Oren Yosifon" <oren@mindcitetech.com>
To: <zope-dev@zope.org>
Sent: Thursday, March 29, 2001 9:35 AM
Subject: [Zope-dev] ZCatalog phrase indexing revisited


Hi all,
I'm asking this again ,in case anything has changed since the last time.
I'm trying to search for a phrase in ZCatalog, but, it doesn't seem to
work.
Let's say I want to search for "foo bar", if i ask ZCatalog to find it,
it treats it as if I wrote "foo OR bar" .

Last time I asked this, SteveA kindly replied:

               You should use quotes to group the phrase.
                 ['"foo bar"']
               Take a look in the source code:
                 lib/python/SearchIndex/UnTextIndex.py
               Follow the flow of code through from line 550: def query(
...=20
however, this doesn't seem to work. You can try it even on the zope.org
website using their search interface. Using the above suggested syntax
(incl. the brackets) returns an error message.

Can anyone help me ?

Thx.
oren.

_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://lists.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists -=20
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope )


------=_NextPart_000_004E_01C0B83E.50132910
Content-Type: text/html;
	charset="windows-1255"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Dwindows-1255" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3D"Courier New" size=3D2>Quoted phrase searching doesn't =
really=20
work.&nbsp; Well, it does, but not the way you'd expect.&nbsp; Zope =
versions=20
below 2.3.1b2 (all the way down to 2.2.1 AFAICT) used to choke and error =
out on=20
quoted-phrase searching.&nbsp; But quoted-phrase searching in Zopes past =
2.3.1b2=20
is essentially turned into an "AND" query instead of erroring out.&nbsp; =
So if=20
you do "foo bar", it's roughly equivalent to "foo AND bar".</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>This of course isn't what most =
people=20
expect, but the machinery for NEAR searching in the catalog was used by =
the=20
quoting operator (e.g. "foo bar" would become "foo NEAR bar").&nbsp;=20
Unfortunately, the NEAR searching machinery *never* worked (and still =
doesnt),=20
so we had to turn the NEAR into an AND to get a reasonable, if =
misleading,=20
result.&nbsp; Hopefully we can graft on real NEAR searching in the =
future.&nbsp;=20
For now, I think "foo AND bar" is about as close as you're going to get =
to=20
phrase searching without post-filtering results.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3D"Courier New" size=3D2>----- Original Message ----- =
</FONT>
<DIV><FONT face=3D"Courier New" size=3D2>From: "Oren Yosifon" =
&lt;</FONT><A=20
href=3D"mailto:oren@mindcitetech.com"><FONT face=3D"Courier New"=20
size=3D2>oren@mindcitetech.com</FONT></A><FONT face=3D"Courier New"=20
size=3D2>&gt;</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>To: &lt;</FONT><A=20
href=3D"mailto:zope-dev@zope.org"><FONT face=3D"Courier New"=20
size=3D2>zope-dev@zope.org</FONT></A><FONT face=3D"Courier New"=20
size=3D2>&gt;</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>Sent: Thursday, March 29, 2001 =
9:35=20
AM</FONT></DIV>
<DIV><FONT face=3D"Courier New" size=3D2>Subject: [Zope-dev] ZCatalog =
phrase=20
indexing revisited</FONT></DIV></DIV>
<DIV><BR></DIV><FONT face=3D"Courier New" size=3D2>Hi all,<BR>I'm asking =
this again=20
,in case anything has changed since the last time.<BR>I'm trying to =
search for a=20
phrase in ZCatalog, but, it doesn't seem to<BR>work.<BR>Let's say I want =
to=20
search for "foo bar", if i ask ZCatalog to find it,<BR>it treats it as =
if I=20
wrote "foo OR bar" .<BR><BR>Last time I asked this, SteveA kindly=20
replied:<BR><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;=20
You should use quotes to group the=20
phrase.<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
['"foo=20
bar"']<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;=20
Take a look in the source=20
code:<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
lib/python/SearchIndex/UnTextIndex.py<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
Follow the flow of code through from line 550: def query(<BR>... =
<BR>however,=20
this doesn't seem to work. You can try it even on the =
zope.org<BR>website using=20
their search interface. Using the above suggested syntax<BR>(incl. the =
brackets)=20
returns an error message.<BR><BR>Can anyone help me=20
?<BR><BR>Thx.<BR>oren.<BR><BR>___________________________________________=
____<BR>Zope-Dev=20
maillist&nbsp; -&nbsp; </FONT><A href=3D"mailto:Zope-Dev@zope.org"><FONT =

face=3D"Courier New" size=3D2>Zope-Dev@zope.org</FONT></A><BR><A=20
href=3D"http://lists.zope.org/mailman/listinfo/zope-dev"><FONT =
face=3D"Courier New"=20
size=3D2>http://lists.zope.org/mailman/listinfo/zope-dev</FONT></A><BR><F=
ONT=20
face=3D"Courier New" size=3D2>**&nbsp; No cross posts or HTML =
encoding!&nbsp;=20
**<BR>(Related lists - <BR>&nbsp;</FONT><A=20
href=3D"http://lists.zope.org/mailman/listinfo/zope-announce"><FONT=20
face=3D"Courier New"=20
size=3D2>http://lists.zope.org/mailman/listinfo/zope-announce</FONT></A><=
BR><FONT=20
face=3D"Courier New" size=3D2>&nbsp;</FONT><A=20
href=3D"http://lists.zope.org/mailman/listinfo/zope"><FONT =
face=3D"Courier New"=20
size=3D2>http://lists.zope.org/mailman/listinfo/zope</FONT></A><FONT=20
face=3D"Courier New" size=3D2> )<BR></FONT></BODY></HTML>

------=_NextPart_000_004E_01C0B83E.50132910--