I'm afraid I mis-documented that. It seems that indeed only "AND NOT" is supported (from $ZOPE_HOME/lib/python/Products/ZCTextIndex/QueryParser.py) Sorry! - peter. Tim Hicks wrote:
Hi Dieter,
Dieter Maurer said:
Tim Hicks wrote at 2003-7-5 16:40 +0100:
I've got a zope 2.6.1 (on solaris if that matters) and a ZCatalog setup with a ZCTextIndex. I also have a search/results pair of page templates that provide an interface for users to actually search the catalog.
All is well with most sorts of queries, except that inputing something like 'word1 NOT word2' throws up a "Parse Error" "Token 'EOF' required, 'NOT' found". The strange thing is that using 'word1 -word2' does work, as does 'word1 AND word2'. Sorry, I'm not able to provide a full traceback just at the moment as I don't have access to the root zope folder - and consequently the error_log *.
Does anybody have any idea what's going wrong?
Where did you read that "NOT" is a supported operand? If you did not read about it, then is is probably not allowed.
I found it at http://www.zope.org/Documentation/Books/ZopeBook/2_6Edition/SearchingZCatalo...
It may be possible that can you use "NOT" only in "AND NOT".
I hadn't tried that, but it does work. Thanks for the tip.
It may be a bug.
Yes, if the documentation is correct, then I think it must be a bug. I'll wait a while longer for people who don't work at the weekend to chime in. After that, I'll file a report in the collector.
thanks.
tim