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

StringIndexOutOfBoundsException in SpellCheckComponent

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 4.3.1, 4.4
    • 4.5
    • spellchecker
    • None
    • all

    Description

      My SOLR request params are as shown below.

      spellcheck=true&enableElevation=true&facet=true&spellcheck.q=minecraft&spellcheck.extendedResults=true&spellcheck.maxCollations=10&spellcheck.collate=true&wt=javabin&defType=edismax&spellcheck.onlyMorePopular=true etc.

      Note: this work fine many use cases, however it fails for some query terms.

      Feb 22, 2013 11:06:04 AM org.apache.solr.common.SolrException log
      SEVERE: null:java.lang.StringIndexOutOfBoundsException: String index out of range: -5
      at java.lang.AbstractStringBuilder.replace(AbstractStringBuilder.java:797)
      at java.lang.StringBuilder.replace(StringBuilder.java:271)
      at org.apache.solr.spelling.SpellCheckCollator.getCollation(SpellCheckCollator.java:190)
      at org.apache.solr.spelling.SpellCheckCollator.collate(SpellCheckCollator.java:75)
      at org.apache.solr.handler.component.SpellCheckComponent.addCollationsToResponse(SpellCheckComponent.java:203)
      at org.apache.solr.handler.component.SpellCheckComponent.process(SpellCheckComponent.java:180)
      at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:206)
      at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129)
      at org.apache.solr.core.SolrCore.execute(SolrCore.java:1699)
      at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:455)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:276)
      at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1337)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:484)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:233)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1065)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:413)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:192)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:999)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:250)
      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:149)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
      at org.eclipse.jetty.server.Server.handle(Server.java:351)
      at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:454)
      at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
      at org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:890)
      at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:944)
      at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:634)
      at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:230)
      at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
      at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
      at java.lang.Thread.run(Thread.java:680)

      Attachments

        1. SOLR-4489.patch
          2 kB
          James Dyer
        2. SOLR-4489.patch
          3 kB
          James Dyer

        Activity

          People

            jdyer James Dyer
            vmarrapu venkata marrapu
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: