Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-8872

Search error (suggestbox or advanced search or faceted) when last keyword ends with "\"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Cannot Reproduce
    • Affects Version/s: 5.5, 5.5.0-HF02
    • Fix Version/s: None
    • Component/s: Query & PageProvider

      Description

      Steps to reproduce:

      • go to advanced search
      • type "test\" in the title field (for instance)
      • submit

      Then the user get the following error message:

      Failed to execute query: org.nuxeo.ecm.core.query.QueryParseException: Syntax error: Invalid token <2012> at offset 122 in query: SELECT * FROM Document WHERE ecm:isCheckedInVersion = 0 AND ecm:fulltext.dc:title = '+test\' AND dc:created <= TIMESTAMP '2012-02-14 00:00:00' AND ecm:currentLifeCycleState != 'deleted' AND (ecm:mixinType != 'HiddenInNavigation' AND ecm:isCheckedInVersion = 0)

      On a non fulltext field such as dc:rights one get a similar error:

      Failed to execute query: org.nuxeo.ecm.core.query.QueryParseException: Syntax error: Invalid token <2012> at offset 112 in query: SELECT * FROM Document WHERE ecm:isCheckedInVersion = 0 AND dc:rights LIKE 'test\' AND dc:created <= TIMESTAMP '2012-02-14 00:00:00' AND ecm:currentLifeCycleState != 'deleted' AND (ecm:mixinType != 'HiddenInNavigation' AND ecm:isCheckedInVersion = 0)

      Fixing for fulltext search field it should ignore the "\" and just consider the "test" token. This could be done in the NXQLQueryBuilder class in the serializeFullText method.

      However for exact search fields it should properly quote the generated NXQL string and I am not sure how to do that.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: