lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gonzalo Carracedo <gonzalo.carrac...@thecommercepartnership.com>
Subject Solr 6.5.1 SpellCheckCollator StringIndexOutOfBoundsException
Date Fri, 21 Jun 2019 11:44:30 GMT
Hello,

I'm using version 6.5.1 and i'm getting the following results when running
this query:

q=coordinates
qt=dismax
spellcheck=true
spellcheck.collate=true


<lst name="error">
  <str name="msg">String index out of range: -6</str>
  <str name="trace">java.lang.StringIndexOutOfBoundsException: String index
out of range: -6
at java.lang.AbstractStringBuilder.replace(AbstractStringBuilder.java:851)
at java.lang.StringBuilder.replace(StringBuilder.java:262)
at
org.apache.solr.spelling.SpellCheckCollator.getCollation(SpellCheckCollator.java:238)
at
org.apache.solr.spelling.SpellCheckCollator.collate(SpellCheckCollator.java:93)
at
org.apache.solr.handler.component.SpellCheckComponent.addCollationsToResponse(SpellCheckComponent.java:296)
at
org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:208)

When setting spellcheck.collate = false, these are the suggestions that
come back:

<lst name="spellcheck">
  <lst name="suggestions">
    <lst name="coords">
      <int name="numFound">2</int>
      <int name="startOffset">0</int>
      <int name="endOffset">11</int>
      <arr name="suggestion">
        <str>cards</str>
        <str>cord</str>
      </arr>
    </lst>
    <lst name="coord">
      <int name="numFound">3</int>
      <int name="startOffset">0</int>
      <int name="endOffset">11</int>
      <arr name="suggestion">
        <str>cord</str>
        <str>court</str>
        <str>colored</str>
      </arr>
    </lst>
    <lst name="co-ordinates">
      <int name="numFound">1</int>
      <int name="startOffset">0</int>
      <int name="endOffset">11</int>
      <arr name="suggestion">
        <str>coordinates</str>
      </arr>
    </lst>
    <lst name="ord">
      <int name="numFound">1</int>
      <int name="startOffset">0</int>
      <int name="endOffset">11</int>
      <arr name="suggestion">
        <str>oud</str>
      </arr>
    </lst>
    <lst name="odd">
      <int name="numFound">1</int>
      <int name="startOffset">0</int>
      <int name="endOffset">11</int>
      <arr name="suggestion">
        <str>oud</str>
      </arr>
    </lst>
  </lst>
</lst>

It seems that the error happens in the following code line in
SpellCheckCollator/getCollation method, we aren't using any custom code:

collation.replace(startIndex, endIndex, corr);

We get the same error for several other search terms. It would be great if
you could shed some light on what might be happening.

Thank you,
Gonzalo

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message