-
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
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.
- is duplicated by
-
NXP-9156 Suggestion box error with backslash char '\'
- Resolved