[Zope] Seaching zcatalog 2.4.2, boolean problem

Small Business Services toolkit@magma.ca
Fri, 1 Feb 2002 14:22:37 -0500


I am trying to get a zcatalog boolean search working in Zope 2.4.2

My objective is to get the following boolean format to work with zcatalog
indexes:

 (indexA=valueA) AND (indexB=valueB OR indexB=valueC)

 where:
    indexA is a zcatalog Text index
    indexB is a zcatalog Field index
    valueA/B/C are entered by the user through an html form


I have tried the following dtml:

<dtml-in "Catalog.searchResults({'indexA' : 'valueA', 'indexB' : 'valueB'},
{'indexA' : 'valueA', 'indexB' : 'valueC'})">

The repetition of indexA is required as .searchResults performs boolean AND
within {} and OR between {} {}.


This search is not working and through some experimentation I have
discovered the following:

<dtml-in "Catalog.searchResults({'indexB' : 'goodvalue'}, {'indexB' :
'goodvalue'})">
              /* returns a valid result set*/

<dtml-in "Catalog.searchResults({'indexB' : 'badvalue'}, {'indexB' :
'badvalue'})">
             /* returns a valid result set (empty set)*/

<dtml-in "Catalog.searchResults({'indexB' : 'goodvalue'}, {'indexB' :
'badvalue'})">
            /* returns a valid result set*/

<dtml-in "Catalog.searchResults({'indexB' : 'badvalue'}, {'indexB' :
'goodvalue'})">
           /* returns INVALID result set (empty set)*/

where:
    goodvalue - exists in index
    badvalue - does not exist in index


Am I doing something wrong?
Is this a bug or undocumented feature?
Is there a work-around?

Any and all help is greatly appreciated!

Jonathan Hobbs