[Zope] ZCatalog keyword search unexpected results with operator=and

Alex crud.spam at verizon.net
Wed May 26 22:44:47 EDT 2004


I'm trying to use a ZCatalog for the first time and I'm getting unexpected
results.

Ultimately I'm trying to be able to search one or more keyword indexes,
searching each one with one or more keywords, and be able to either AND or
OR across the board, but I can't seem to be able to get AND working within
an index.

I am using a keyword index on a list field. I have manually updated the
catalog and verified the index contents. Zope version is 2.7.0.

In a Python script I have :

results=context.catalog(categories={'query':['big','shiny'],
'operator':'and'})

If some objects are big, and some are shiny, but none are big and shiny, I
get no results - as expected.

But if some objects are big, and there are no objects that are shiny, then I
get all objects that are big - I expected to get no results.

Is this by design or am I doing something wrong ?

Thanks,
Alex





More information about the Zope mailing list