Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-8572

StringIndexOutOfBoundsException in parser/EscapeQuerySyntaxImpl.java

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 6.3
    • Fix Version/s: None
    • Component/s: core/queryparser
    • Labels:
      None

      Description

      With "lucene-queryparser-6.3.0", specifically in
      "org/apache/lucene/queryparser/flexible/standard/parser/EscapeQuerySyntaxImpl.java"
       
      when escaping strings containing extended unicode chars, and with a locale distinct from that of the character set the string uses, the process fails, with a "java.lang.StringIndexOutOfBoundsException".
       
      The reason is that the comparison is done by previously converting all of the characters of the string to lower case chars, and by doing this, the original string size isn't anymore the same, but less, as of the transformed one, so that executing
       
      org/apache/lucene/queryparser/flexible/standard/parser/EscapeQuerySyntaxImpl.java:89

      fails with a java.lang.StringIndexOutOfBoundsException.

      I wonder whether the transformation to lower case is really needed when treating the escape chars, since by avoiding it, the error may be avoided.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              tonicava Octavian Mocanu
            • Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

              • Created:
                Updated: