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

FastVectorHighlighter: String Out of bounds exception when phrase query with a fairly big slop is used (pf is used in edismax)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 4.1, 4.2
    • None
    • highlighter
    • None
    • Windows 7

    Description

      On a clean install of 4.2, do the following to reproduce the issue
      Start Solr
      Post the attached document to solr. (from example docs run java -jar post.jar a2.xml)
      Run the following query
      http://localhost:8983/solr/select/?q=%2B_query_%3A%22%7B%21type%3Dedismax+qf%3D%27includes%5E1.0+title%5E10.0%27+pf%3D%27includes%5E2%27+ps%3D28+v%3D%27thai%20vietnamese%20documentation%27+mm%3D100%25%7D%22&fl=title%20id%2Cscore&hl.fl=includes%20%20title&hl=true&hl.useFastVectorHighlighter=true

      You will get the following error

      java.lang.StringIndexOutOfBoundsException: String index out of range: -52 at java.lang.String.substring(Unknown Source) at org.apache.lucene.search.vectorhighlight.BaseFragmentsBuilder.makeFragment(BaseFragmentsBuilder.java:178) at org.apache.lucene.search.vectorhighlight.BaseFragmentsBuilder.createFragments(BaseFragmentsBuilder.java:144) at org.apache.lucene.search.vectorhighlight.FastVectorHighlighter.getBestFragments(FastVectorHighlighter.java:186) at org.apache.solr.highlight.DefaultSolrHighlighter.doHighlightingByFastVectorHighlighter(DefaultSolrHighlighter.java:556) at org.apache.solr.highlight.DefaultSolrHighlighter.doHighlighting(DefaultSolrHighlighter.java:389) at org.apache.solr.handler.component.HighlightComponent.process(HighlightComponent.java:139) at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:208) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1797) at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:637) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:343) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:141) at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1307) at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:453) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137) at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:560) at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231) at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1072) at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:382) at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193) at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1006) at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135) at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255) at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154) at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116) at org.eclipse.jetty.server.Server.handle(Server.java:365)

      Note – removing pf or increasing ps or setting useFastVectorHighlighter=false will return the highlighted result.

      Attachments

        1. a2.xml
          8 kB
          Kannan Chellappa

        Issue Links

          Activity

            People

              Unassigned Unassigned
              kchellappa Kannan Chellappa
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: