在搜索查询中添加单词AND,OR,NOT会在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, 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
有人可以解释Plone的LiveSearch搜索背后的逻辑吗?有没有办法避免这种情况,或者我可以从日志文件中忽略这些消息?
答案 0 :(得分:2)
忽略它们,它是ZCTextIndex行为。只记录错误,查询不返回任何内容。在你的plone网站的某个地方作为“单词”并编入索引,尝试在plone中搜索类似“AND word OR”的内容,即使“单词”存在,也看不到任何返回。尝试只搜索“单词”,你会看到结果。