This should be considered a bug. Feel free file jira for this.
Joel Bernstein http://joelsolr.blogspot.com/ On Tue, Jun 4, 2019 at 9:16 AM aus...@3bx.org.INVALID <aus...@3bx.org.invalid> wrote: > Just wanted to provide a bit more information on this issue after > experimenting a bit more. > > The error I've described below only seems to occur when I'm > collapsing/expanding on an integer field. If I switch the field type to a > string, no errors occur if there are missing field values within the > document set. For now, this seems to be a workaround, but I'd be curious > if there is an issue or something I missed when trying to use this feature > with integers. > > > On Tue, May 28, 2019 at 3:22 PM aus...@3bx.org <aus...@3bx.org> wrote: > > > Hi all, > > > > > > > > I’m currently running 7.5.0 and am looking to use the collapse and expand > > results functionality. > > > > > > > > The field I’m attempting to collapse on is an “int” field that isn’t > > required, and I’m using a null policy of expand to create a unique group > > for each document that has a missing field. The majority of documents > *are > > *missing this field at this time. > > > > > > > > I’m running into a NullPointerException on the response from within the > > ExpandComponent. I’ve also tried the grouping with a field where I’ve > > generated an ID (to cause the field to never be null), which seems to > > resolve the issue. I’m wondering if there’s some type of issue with how > > Solr is handling the expansion of these null records. > > > > > > > > Any thoughts? > > > > > > > > > > > > Here’s an example request: > > > > > > > > > > > https://localhost:8985/solr/products/select?fq=%7B!collapse%20field%3DGroupId_i%20nullPolicy%3Dexpand%7D&qf=Name%5E100&start=0&rows=5&version=2.2&q=test&expand=true&expand.rows=1&sort=score%20desc&fl=ItemId > > > > > > > > … and the response > > > > > > > > <?xml version="1.0" encoding="UTF-8"?> > > > > <response> > > > > <lst name="responseHeader"> > > > > <bool name="zkConnected">true</bool> > > > > <int name="status">500</int> > > > > <int name="QTime">19</int> > > > > <lst name="params"> > > > > <str name="q">test</str> > > > > <str name="expand">true</str> > > > > <str name="expand.rows">1</str> > > > > <str name="qf">Name^100</str> > > > > <str name="fl">ItemId</str> > > > > <str name="start">0</str> > > > > <str name="fq">{!collapse field=GroupId_i > nullPolicy=expand}</str> > > > > <str name="sort">score desc</str> > > > > <str name="rows">5</str> > > > > <str name="version">2.2</str> > > > > </lst> > > > > </lst> > > > > <result name="response" numFound="46086" start="0"> > > > > <doc> > > > > <int name="ItemId">186209</int> > > > > </doc> > > > > <doc> > > > > <int name="ItemId">3516830</int> > > > > </doc> > > > > <doc> > > > > <int name="ItemId">9764413</int> > > > > </doc> > > > > <doc> > > > > <int name="ProductID">9764705</int> > > > > </doc> > > > > <doc> > > > > <int name="ProductID">9764767</int> > > > > </doc> > > > > </result> > > > > <lst name="error"> > > > > <str name="trace">java.lang.NullPointerException > > > > at > > > org.apache.solr.handler.component.ExpandComponent.process(ExpandComponent.java:351) > > > > at > > > org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:298) > > > > at > > > org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:199) > > > > at org.apache.solr.core.SolrCore.execute(SolrCore.java:2541) > > > > at > > org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:709) > > > > at > org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:515) > > > > at > > > org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:377) > > > > at > > > org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:323) > > > > at > > > org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634) > > > > at > > > org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533) > > > > at > > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) > > > > at > > > org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) > > > > at > > > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) > > > > at > > > org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) > > > > at > > > org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595) > > > > at > > > org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) > > > > at > > > org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317) > > > > at > > > org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) > > > > at > > org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473) > > > > at > > > org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564) > > > > at > > > org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) > > > > at > > > org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219) > > > > at > > > org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) > > > > at > > > org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:219) > > > > at > > > org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126) > > > > at > > > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) > > > > at > > > org.eclipse.jetty.rewrite.handler.RewriteHandler.handle(RewriteHandler.java:335) > > > > at > > > org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) > > > > at org.eclipse.jetty.server.Server.handle(Server.java:531) > > > > at > > org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352) > > > > at > > > org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260) > > > > at > > org.eclipse.jetty.io > .AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281) > > > > at > > org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102) > > > > at > > org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) > > > > at > > > org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) > > > > at > > > org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) > > > > at > > > org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) > > > > at > > > org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) > > > > at > > > org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) > > > > at > > > org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762) > > > > at > > > org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680) > > > > at java.base/java.lang.Thread.run(Thread.java:834)</str> > > > > <int name="code">500</int> > > > > </lst> > > > > </response> > > > > > > >