Dieter, I don't think its a bug...it looks very purposefull! The KeywordIndex uses the same _apply_index() as the FieldIndex, so will match on the same values. The method uses BTree.IITreeSet.intersection if the operator is 'and' on the keywords, and as clearly documented in IITreeSet.Interfaces, the intersection method if provided two sets, one which is None, will return the other set. So if one keyword has no matches, then the result is essentially ignored. terry
Terry Kerr wrote at 2003-4-20 15:54 +1000:
Please use a useful subject...
I have a Keyword Index setup in a Catalog, and when I search for more than one keyword using a query such as {'query':['one', 'two'], 'operator':'and'}, and there are no indexed records with either of the keywords, all records in the Catalog are returned. In this instance, I want NO records to be returned. Is this easily possible?
Sounds like a bug...
File a collector report (<http://collector.zope.org>).
Look at the implementation and try to fix the bug.
Dieter
-- Terry Kerr terry@adroit.net Adroit Internet Solutions www.adroit.net +61 3 9563 4461