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

Join query can sometimes throw an exception if highlighted

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 5.3
    • Fix Version/s: None
    • Component/s: highlighter
    • Labels:
      None
    • Environment:

      SolrCloud 5.3.1

      Description

      If you use the combination of a join query with the 'old' QueryScorer as a highlighter, you get a classcast exception

      java.lang.ClassCastException: org.apache.lucene.search.IndexSearcher cannot be cast to org.apache.solr.search.SolrIndexSearcher
      	at org.apache.solr.search.JoinQuery.createWeight(JoinQParserPlugin.java:217)
      	at org.apache.lucene.search.IndexSearcher.createWeight(IndexSearcher.java:855)
      	at org.apache.lucene.search.IndexSearcher.createNormalizedWeight(IndexSearcher.java:838)
      	at org.apache.lucene.search.highlight.QueryTermExtractor.getTerms(QueryTermExtractor.java:131)
      	at org.apache.lucene.search.highlight.QueryTermExtractor.getTerms(QueryTermExtractor.java:106)
      	at org.apache.lucene.search.highlight.QueryTermExtractor.getTerms(QueryTermExtractor.java:119)
      	at org.apache.lucene.search.highlight.QueryTermExtractor.getTerms(QueryTermExtractor.java:62)
      	at org.apache.lucene.search.highlight.QueryTermScorer.<init>(QueryTermScorer.java:52)
      	at org.apache.solr.highlight.DefaultSolrHighlighter.getQueryScorer(DefaultSolrHighlighter.java:244)
      	at org.apache.solr.highlight.DefaultSolrHighlighter.getHighlighter(DefaultSolrHighlighter.java:197)
      	at org.apache.solr.highlight.DefaultSolrHighlighter.doHighlightingByHighlighter(DefaultSolrHighlighter.java:586)
      	at org.apache.solr.highlight.DefaultSolrHighlighter.doHighlighting(DefaultSolrHighlighter.java:428)
      	at org.apache.solr.handler.component.HighlightComponent.process(HighlightComponent.java:143)
      	at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:277)
      	at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:143)
      

      the query parameters that will produce this are

      ?hl=true
      &hl.usePhraseHighlighter=false
      &hl.fl=somefield
      &q={!join from=x to=y}somequery
      

      This does not happen when the default SpanScorer is used (which happens when hl.usePhraseHighlighter=true or is unspecified)

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                PeterCiuffetti Peter Ciuffetti
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: