Ticket #2963 (confirmed Bug)

Opened 10 years ago

Last modified 20 months ago

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

Products.CMFPlone-broken-searchterms.patch Download (671 bytes) - added by msmith64 3 years ago.
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".

Change History

comment:1 Changed 10 years ago by ajung01

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.

comment:2 Changed 10 years ago by Anonymous User

my patch catches any errors right now.

comment:3 Changed 10 years ago by ajung01

i applied the patch to the Plone HEAD.

comment:4 Changed 10 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 3 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 3 years ago by msmith64

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 3 years ago by rossp

  • Description modified (diff)

comment:7 Changed 22 months ago by davisagli

  • Component changed from Infrastructure to General

comment:8 Changed 20 months ago by eleddy

  • Status changed from reopened to confirmed
  • Keywords searchlivesearchParseError added; search livesearch ParseError removed
  • Version set to 4.2
Note: See TracTickets for help on using tickets.