Rv: Re: [Zope] why a xcatalog keywordindex is mandatory?
The ZCatalog treats an empty *string* in a special way to support search forms: an empty string is considered as "no restriction".
A ":lines" control does not return a string but a list. An empty list is not considered as "no restriction".
What you see here, is a bug in the "AND" implementation of "KeywordIndex". An empty list together with the "AND" operator should be interpreted as "no restriction". Due to the bug, it is considered as "no results".
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. ________________________________________________ Message sent using ALFANET Caorle WEBMAIL 1.0
Yurj wrote at 2003-12-7 12:37 -0100:
... 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.
From a semantic point of view, it is wrong: it lets an empty "OR" search return everything.
Maybe, you are not interested in such issues... -- Dieter
participants (2)
-
Dieter Maurer -
Yurj