Uploaded image for project: 'Zanata'
  1. ZNTA-1253

escape lucene key words so that it can parse the string

    Details

    • Type: Bug
    • Status: Closed (View workflow)
    • Priority: Low
    • Resolution: Ready for Release
    • Affects Version/s: None
    • Fix Version/s: platform-4.0.0
    • Component/s: None
    • Labels:
      None
    • Tested Version/s:
      None
    • Sprint:
      16.14

      Description

      From bug hunt, server logs the error:

      
      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.

        Attachments

          Activity

            People

            • Assignee:
              pahuang Patrick Huang
              Reporter:
              pahuang Patrick Huang
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: