[Zope] no 'operator' query option with zctextindex?

Andreas Jung Andreas Jung <andreas@andreas-jung.com>
Thu, 17 Jul 2003 14:24:53 +0200


--On Donnerstag, 17. Juli 2003 13:20 Uhr +0100 Richard Ettema 
<richard.ettema@yoursolutions.com> wrote:

> Hi,
>
> I'm currently upgrading a site to run on 2.6.1 (previously 2.5.1). I have
> been testing the search facility with textindex replaced with zctextindex.
>
> ZCTextIndex Settings:
> 1. Okapi BM25 Rank
> Lexicon Settings:
> 1. Splitter
> 2. CaseNormalizer
> 3. StopWordAndSingleCharRemover
>
> If I do a search on the text 'bike helmet' (without quotes) I would like
> any item with the word 'bike' or 'helmet' to be returned. (An 'OR' search
> by default). The user has the ability to choose a drop-down for "any
> words" or "all words" to over-ride the default to an "OR" or "AND". This
> passes the chosen 'operator' to the catalog with {'query':'bike helmet',
> 'operator':'or'}.
> ZCTextIndex only returns items matching the whole phrase "bike helmet",
> the original textindex worked fine by matching the individual words.
>

you have to search 'bike OR helmet'


> I have found in zctextindex.py the query options available is only the
> 'query'. Is there a reason why zctextindex doesn't allow an operator to be
> passed like textindex? TextIndex was working fine, I am interested in
> using ZCTextIndex for its improved relevance scoring.

the 'operator' option is not support. you might look at TextIndexNG.
It offers a "DumbQueryParser" that should fit your needs.

-aj