Re: [Zope] Query Keyword Index unexpected behavior
Dieter Maurer wrote:
should return objects that have both "foo" AND "bar". In my case, no objects with "bar", but with "foo" a lot. The expr above returns ALL objects with "foo". Is it expected behavior?
A really long standing bug...
Is there a collector entry for this?
cheers,
Chris
Dear Chris, this is an "already discussed issue" :) http://www.dzug.org/mailinglisten/zope-org-zope/archive/2003/2003-12/1070709...
The ZCatalog treats an empty *string* in a special way to support[...] "AND"[...]
I've solved it in /PluginIndexes/common/util.py. When the param is a record, around line 95, I've added: if keys == ['']: keys = None Is it correct? Seems to work with all indexes I've and KeywordIndexes, which works also with AND as operator. --- Note: you also have to use lines to use the KeywordIndex: <textarea name="COLL:lines"></textarea> That was my solution. I think the "ManagableIndex" with the KeywordIndex replacement should be added, maybe calling it KeywordIndexNG :)
Yuri wrote:
this is an "already discussed issue" :)
http://www.dzug.org/mailinglisten/zope-org-zope/archive/2003/2003-12/1070709...
That thread seems pretty confused :-S
The ZCatalog treats an empty *string* in a special way to support[...]
"AND"[...]
Not really to support AND, it treats it in a special way to support html search forms that send empty strings when a field is left empty...
I've solved it in /PluginIndexes/common/util.py. When the param is a record, around line 95, I've added:
if keys == ['']: keys = None
Is it correct?
Almost certainly not. Please raise an issue in the collector so we can tackle this properly... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk
participants (2)
-
Chris Withers -
Yuri