We're updating the issue view to help you get more done.Learn more

escape lucene key words so that it can parse the string

From bug hunt, server logs the error:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Can't parse query TransMemoryQuery{searchType=FUZZY, queries=[AND to create a new criterion that must also be true], project=null, document=null, res=null, includeOwnTranslation=Condition{isCheck=true, value='null'}} at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:211) at org.zanata.service.impl.TranslationMemoryServiceImpl.buildContentQuery(TranslationMemoryServiceImpl.java:850) ... Caused by: org.apache.lucene.queryParser.ParseException: Encountered " <AND> "AND "" at line 1, column 0. Was expecting one of: <NOT> ... "+" ... "-" ... <BAREOPER> ... "(" ... "*" ... <QUOTED> ... <TERM> ... <PREFIXTERM> ... <WILDTERM> ... "[" ... "{" ... <NUMBER> ... <TERM> ... "*" ... at org.apache.lucene.queryParser.QueryParser.generateParseException(QueryParser.java:1849) at org.apache.lucene.queryParser.QueryParser.jj_consume_token(QueryParser.java:1731) at org.apache.lucene.queryParser.QueryParser.Clause(QueryParser.java:1337) at org.apache.lucene.queryParser.QueryParser.Query(QueryParser.java:1245) at org.apache.lucene.queryParser.QueryParser.TopLevelQuery(QueryParser.java:1234)

When this happen we should try to gather more information like document, project, iteration ids via lucene projections, and compare them to the values in the entity.

Status

Assignee

Patrick Huang

Reporter

Patrick Huang

Tested Version/s

None

Time estimate

3h

Sprint

None

Fix versions

Priority

Low