Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-3300

SpellChecker and Dismax fail when using value from q containing hyphen

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.5
    • Fix Version/s: 3.6
    • Component/s: spellchecker
    • Labels:
      None

      Description

      Using a URL like this:
      http://localhost:8080/solr/select/?q=%22Haddington-Cobbs%22&spellcheck=true&defType=edismax&qt=dismax

      Returns an error:
      String index out of range: -6 java.lang.StringIndexOutOfBoundsException: String index out of range: -6 at java.lang.AbstractStringBuilder.replace(AbstractStringBuilder.java:793) at java.lang.StringBuilder.replace(StringBuilder.java:288) at org.apache.solr.spelling.SpellCheckCollator.getCollation(SpellCheckCollator.java:131) at org.apache.solr.spelling.SpellCheckCollator.collate(SpellCheckCollator.java:69) at org.apache.solr.handler.component.SpellCheckComponent.addCollationsToResponse(SpellCheckComponent.java:179) at org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:156) at

      It appears when the spellchecker takes the value from q, it is crashing when their is a hyphen.

      Yet if I instead use spellchecker.q, it works:
      http://localhost:8080/solr/select/?q=%22Haddington-Cobbs%22&spellcheck=true&spellcheck.q=%22Haddington-Cobbs%22&defType=edismax&qt=dismax

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                phareous Michael Long
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: