解析错误:令牌“ATOM”必填,u'AND'在实时搜索中找到

发布于 2024-11-26 21:07:09 字数 1915 浏览 0 评论 0原文

将 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 中搜索背后的逻辑是什么吗?有什么方法可以避免这种情况,或者我可以忽略日志文件中的这些消息吗?

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, 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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

难如初 2024-12-03 21:07:09

忽略它们,这是 ZCTextIndex 行为。该错误仅被记录,并且查询不返回任何内容。在您的 plone 站点中的某个位置存在“word”并已编入索引,尝试在 plone 中搜索“AND word OR”之类的内容,即使“word”存在,也不会看到任何返回。尝试仅搜索“单词”,您就会看到结果。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文