Ticket #2963 (confirmed Bug)
Search keywords raise errors
Reported by: | vds | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 4.x |
Component: | General | Version: | 4.2 |
Keywords: | searchlivesearchParseError | Cc: |
Description (last modified by rossp) (diff)
Typing one of - or and not into the search box raise a ParseError: Token 'ATOM' required, 'and' found
Attachments
Change History
comment:4 Changed 12 years ago by tiran
- Status changed from new to closed
- Resolution set to fixed
Fixed by allowing access to Products.ZCTextIndex.ParseTree.ParseError and catching ParseError in the queryCatalog script. A bare exception is evil!
comment:5 Changed 5 years ago by ctxlken
- Status changed from closed to reopened
- Keywords search livesearch ParseError added
- Resolution fixed deleted
- Milestone changed from Past to 4.x
This does not prevent livesearch from working, but I suspect it could be impacting the returned search results (although difficult to tell, since livesearch returns different results than the search form does, as they, at least, treat wildcarding differently.)
As of Plone 4.0.2, if I perform a livesearch search that includes 'AND' or 'OR' query filters, I see one of these errors in the log.
ParseError: Token 'ATOM' required, 'AND' found
ParseError: Token 'ATOM' required, 'OR' found
Perhaps the fix noted above needs to be tweaked a bit for a newer version of ParseTree being used in Plone 4?
Steps to reproduce:
On your Plone 4 site, in the livesearch box, enter a search such as "plone AND performance" or "plone OR documentation" (or whatever terms produce some results on your site), and then view the event log for the site and you'll see one of these errors.
ParseError: Token 'ATOM' required, 'AND' found
ParseError: Token 'ATOM' required, 'OR' found
Changed 5 years ago by msmith64
-
attachment
Products.CMFPlone-broken-searchterms.patch
added
This isn't a perfect solution, but I believe it demonstrates that this problem really resides in (Script) livesearch_reply in Plone. There are two weirdnesses: 1. ZCTextIndex cannot handle consecutive boolean search terms; 2. except that "NOT" must be preceded by "AND".
comment:6 Changed 5 years ago by rossp
- Description modified (diff)
I've run into questions about this a lot:
http://stackoverflow.com/questions/6865061/parseerror-token-atom-required-uand-found-on-livesearch
This is not a Plone issue but a ZCTextIndex issue. Either you accept any kind of error messages being displayed or you have to catch any error raised by the ZCatalog.