ParseError: Token 'ATOM' required, u'AND' found on LiveSearch
adding the words AND, OR, NOT to a search query raises an error like this one in Plone 4.1:
2011-07-28 14:52:46 ERROR Zope.SiteErrorLog 1311882766.090.999612944712 http://localhost:8080/Plone/livesearch_reply
Traceback (innermost last):
Module ZPublisher.Publish, line 126, in publish
Module ZPublisher.mapply, line 77, in mapply
Module Products.PDBDebugMode.runcall, line 70, in pdb_runcall
Module ZPublisher.Publish, line 46, in call_object
Module Products.CMFCore.FSPythonScript, line 130, in __call__
Module Shared.DC.Scripts.Bindings, line 322, in __call__
Module Shared.DC.Scripts.Bindings, line 359, in _bindAndExec
Module Products.PythonScripts.PythonScript, line 344, in _exec
Module script, line 73, in livesearch_reply
- <FSPythonScript at /Plone/livesearch_reply>
- Line 73
Module AccessControl.ZopeGuards, line 373, in guarded_apply
Module AccessControl.ZopeGuards, line 395, in builtin_guarded_apply
Module Products.CMFPlone.CatalogTool, line 430, in searchResults
Module Products.ZCatalog.ZCatalog, line 604, in searchResults
Module Products.ZCatalog.Catalog, line 902, in searchResults
Module Products.ZCatalog.Catalog, line 528, in search
Module Products.ZCTextIndex.ZCTextIndex,开发者_JAVA百科 line 222, in _apply_index
Module Products.ZCTextIndex.QueryParser, line 135, in parseQuery
Module Products.ZCTextIndex.QueryParser, line 175, in _parseOrExpr
Module Products.ZCTextIndex.QueryParser, line 193, in _parseAndExpr
Module Products.ZCTextIndex.QueryParser, line 210, in _parseNotExpr
Module Products.ZCTextIndex.QueryParser, line 223, in _parseTerm
Module Products.ZCTextIndex.QueryParser, line 242, in _parseAtom
Module Products.ZCTextIndex.QueryParser, line 170, in _get
Module Products.ZCTextIndex.QueryParser, line 156, in _require
ParseError: Token 'ATOM' required, u'AND' found
can someone explain what's the logic behind searches in Plone's LiveSearch? is there any way to avoid this or may I just ignore these messages from log file?
Ignore them, it is a ZCTextIndex behaviour. The error is just logged and the query returns nothing. Being "word" somewhere in your plone site and indexed, try to search in plone something like "AND word OR" and see nothing returns even if "word" is there. Try to search only "word" and you'll see the result.
精彩评论