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

NullPointerException when using facets in More Like This Handler

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 9.1.1
    • 9.2
    • None
    • None

    Description

      I have a MoreLikeThis query handler set up on my index:

      <requestHandler name="/mlt" class="solr.MoreLikeThisHandler">
          <lst name="defaults">
            <str name="echoParams">all</str>
            <int name="rows">10</int>
             <str name="mlt.fl">text</str>
          </lst>
        </requestHandler>

      If I use faceting on a query with no no tagging and exclusion everything works as expected. eg:
       
      /mlt?facet.field=genre&facet.mincount=1&facet=true&fq=genre:{GENRE_VALUE}&indent=true&q.op=OR&q=id:{DOCUMENT_ID}

      When I add tagging and exclusion the facet counts are not returned and I get a null pointer exception:
       
      /mlt?facet.field={!ex=g}genre&facet.mincount=1&facet=true&fq={!tag=g}genre:{GENRE_VALUE}&indent=true&q.op=OR&q=id:{DOCUMENT_ID}
       
      Here is the stack trace:

      java.lang.NullPointerException
      at java.base/java.util.Objects.requireNonNull(Objects.java:208)
      at com.github.benmanes.caffeine.cache.BoundedLocalCache.put(BoundedLocalCache.java:2196)
      at com.github.benmanes.caffeine.cache.BoundedLocalCache.putIfAbsent(BoundedLocalCache.java:2182)
      at com.github.benmanes.caffeine.cache.LocalAsyncCache$AsyncAsMapView.putIfAbsent(LocalAsyncCache.java:316)
      at com.github.benmanes.caffeine.cache.LocalAsyncCache$AsyncAsMapView.putIfAbsent(LocalAsyncCache.java:291)
      at org.apache.solr.search.CaffeineCache.computeAsync(CaffeineCache.java:209)
      at org.apache.solr.search.CaffeineCache.computeIfAbsent(CaffeineCache.java:250)
      at org.apache.solr.search.SolrIndexSearcher.getAndCacheDocSet(SolrIndexSearcher.java:970)
      at org.apache.solr.search.SolrIndexSearcher.getPositiveDocSet(SolrIndexSearcher.java:927)
      at org.apache.solr.search.SolrIndexSearcher.getProcessedFilter(SolrIndexSearcher.java:1192)
      at org.apache.solr.search.SolrIndexSearcher.getDocSet(SolrIndexSearcher.java:1091)
      at org.apache.solr.request.SimpleFacets.computeDocSet(SimpleFacets.java:258)
      at org.apache.solr.request.SimpleFacets.parseParams(SimpleFacets.java:216)
      at org.apache.solr.request.SimpleFacets.getFacetFieldCounts(SimpleFacets.java:898)
      at org.apache.solr.handler.component.FacetComponent.getFacetCounts(FacetComponent.java:337)
      at org.apache.solr.handler.component.FacetComponent.getFacetCounts(FacetComponent.java:299)
      at org.apache.solr.handler.MoreLikeThisHandler.handleRequestBody(MoreLikeThisHandler.java:223)
      at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:224)
      at org.apache.solr.core.SolrCore.execute(SolrCore.java:2865)
      at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:887)
      at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:606)
      at org.apache.solr.servlet.SolrDispatchFilter.dispatch(SolrDispatchFilter.java:250)
      at org.apache.solr.servlet.SolrDispatchFilter.lambda$doFilter$0(SolrDispatchFilter.java:218)
      at org.apache.solr.servlet.ServletUtils.traceHttpRequestExecution2(ServletUtils.java:257)
      at org.apache.solr.servlet.ServletUtils.rateLimitRequest(ServletUtils.java:227)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:213)
      at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:195)
      at org.eclipse.jetty.servlet.FilterHolder.doFilter(FilterHolder.java:201)
      at org.eclipse.jetty.servlet.ServletHandler$Chain.doFilter(ServletHandler.java:1626)
      at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:552)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
      at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:600)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:235)
      at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1624)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:233)
      at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1440)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:188)
      at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:505)
      at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1594)
      at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:186)
      at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1355)
      at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
      at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:191)
      at org.eclipse.jetty.server.handler.InetAccessHandler.handle(InetAccessHandler.java:177)
      at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:146)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
      at org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:322)
      at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:772)
      at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:127)
      at org.eclipse.jetty.server.Server.handle(Server.java:516)
      at org.eclipse.jetty.server.HttpChannel.lambda$handle$1(HttpChannel.java:487)
      at org.eclipse.jetty.server.HttpChannel.dispatch(HttpChannel.java:732)
      at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:479)
      at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:277)
      at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:311)
      at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:105)
      at org.eclipse.jetty.io.ChannelEndPoint$1.run(ChannelEndPoint.java:104)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:338)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:315)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:173)
      at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:131)
      at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:409)
      at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:883)
      at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1034)
      at java.base/java.lang.Thread.run(Thread.java:833)

       

      Attachments

        Activity

          People

            mkhl Mikhail Khludnev
            gracesainsbury Grace Sainsbury
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 20m
                20m