You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Gonzalo Carracedo <go...@thecommercepartnership.com> on 2019/06/21 11:44:30 UTC

Solr 6.5.1 SpellCheckCollator StringIndexOutOfBoundsException

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

Re: Solr 6.5.1 SpellCheckCollator StringIndexOutOfBoundsException

Posted by Gonzalo Carracedo <go...@thecommercepartnership.com>.
Hi Erick,

It seems to be a very similar issue. However, no one has reply with a
solution for it yet.

Regards,
Gonzalo

On Fri, 21 Jun 2019 at 17:32, Erick Erickson <er...@gmail.com>
wrote:

> Possibly https://issues.apache.org/jira/browse/SOLR-13360
>
> > On Jun 21, 2019, at 4:44 AM, Gonzalo Carracedo <
> gonzalo.carracedo@thecommercepartnership.com> wrote:
> >
> > StringIndexOutOfBoundsException
>
>

Re: Solr 6.5.1 SpellCheckCollator StringIndexOutOfBoundsException

Posted by Erick Erickson <er...@gmail.com>.
Possibly https://issues.apache.org/jira/browse/SOLR-13360

> On Jun 21, 2019, at 4:44 AM, Gonzalo Carracedo <go...@thecommercepartnership.com> wrote:
> 
> StringIndexOutOfBoundsException