The bug only occurs if you collapse on a numeric field. If you can re-index
the field into a String field it should work fine.

You can also use grouping with facets. Depending on you usecase this might
be your best choice:

https://cwiki.apache.org/confluence/display/solr/Result+Grouping

Joel Bernstein
http://joelsolr.blogspot.com/

On Fri, Jan 15, 2016 at 3:04 PM, sara hajili <hajili.s...@gmail.com> wrote:

> Tnx Joel.
> I wanted to get distinct result from solr.so I found to approach collapse
> filter  and facet.
> And more like this doesn't support facet. And as u said solr 5.3 has bug on
> collapse filter.
> If I wont to immigrate to solr 5.4.
> Is any other approach to get distinct value that I can use in solr  5.3.1?
> On Jan 12, 2016 1:39 AM, "Joel Bernstein" <joels...@gmail.com> wrote:
>
> > I went to go work on the issue and found it was already fixed 7 weeks
> ago.
> > The bug fix is available in Solr 5.4.
> >
> > Joel Bernstein
> > http://joelsolr.blogspot.com/
> >
> > On Mon, Jan 11, 2016 at 3:12 PM, Susheel Kumar <susheel2...@gmail.com>
> > wrote:
> >
> > > You can go to https://issues.apache.org/jira/browse/SOLR/ and create
> > Jira
> > > ticket after signing in.
> > >
> > > Thanks,
> > > Susheel
> > >
> > > On Mon, Jan 11, 2016 at 2:15 PM, sara hajili <hajili.s...@gmail.com>
> > > wrote:
> > >
> > > > Tnx.How I can create a jira ticket?
> > > > On Jan 11, 2016 10:42 PM, "Joel Bernstein" <joels...@gmail.com>
> wrote:
> > > >
> > > > > I believe this is a bug. I think the reason this is occurring is
> that
> > > you
> > > > > have an index segment with no values at all in the collapse field.
> If
> > > you
> > > > > could create a jira ticket for this I will look at resolving the
> > issue.
> > > > >
> > > > > Joel Bernstein
> > > > > http://joelsolr.blogspot.com/
> > > > >
> > > > > On Mon, Jan 11, 2016 at 2:03 PM, sara hajili <
> hajili.s...@gmail.com>
> > > > > wrote:
> > > > >
> > > > > > I am using solr 5.3.1
> > > > > > On Jan 11, 2016 10:30 PM, "Joel Bernstein" <joels...@gmail.com>
> > > wrote:
> > > > > >
> > > > > > > Which version of Solr are you using?
> > > > > > >
> > > > > > > Joel Bernstein
> > > > > > > http://joelsolr.blogspot.com/
> > > > > > >
> > > > > > > On Mon, Jan 11, 2016 at 6:39 AM, sara hajili <
> > > hajili.s...@gmail.com>
> > > > > > > wrote:
> > > > > > >
> > > > > > > > hi all
> > > > > > > > i have a MLT query and i wanna to use collapse filter query.
> > > > > > > > and i wanna to use collapse expand nullPolicy.
> > > > > > > > in this way when i used it :
> > > > > > > > {!collapse field=original_post_id nullPolicy=expand}
> > > > > > > > i got my appropriate result .
> > > > > > > > (in solr web UI)
> > > > > > > >
> > > > > > > > but in regular search handler "/select",when i used
> > > > > > > > {!collapse field=original_post_id nullPolicy=expand}
> > > > > > > > i got error:
> > > > > > > >
> > > > > > > > {
> > > > > > > >   "responseHeader":{
> > > > > > > >     "status":500,
> > > > > > > >     "QTime":2,
> > > > > > > >     "params":{
> > > > > > > >       "q":"*:*",
> > > > > > > >       "indent":"true",
> > > > > > > >       "fq":"{!collapse field=original_post_id
> > > nullPolicy=expand}",
> > > > > > > >       "wt":"json"}},
> > > > > > > >   "error":{
> > > > > > > >     "trace":"java.lang.NullPointerException\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.solr.search.CollapsingQParserPlugin$IntScoreCollector.finish(CollapsingQParserPlugin.java:763)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.solr.search.SolrIndexSearcher.buildAndRunCollectorChain(SolrIndexSearcher.java:211)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1678)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1497)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:555)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:522)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:277)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:143)\n\tat
> > > > > > > >
> org.apache.solr.core.SolrCore.execute(SolrCore.java:2068)\n\tat
> > > > > > > >
> > > > > >
> > > >
> > org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:669)\n\tat
> > > > > > > >
> > > > >
> > org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:462)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:214)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:179)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1652)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:585)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)\n\tat
> > > > > > > > org.eclipse.jetty.server.Server.handle(Server.java:499)\n\tat
> > > > > > > >
> > > > >
> > org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)\n\tat
> > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)\n\tat
> > > > > > > > java.lang.Thread.run(Thread.java:745)\n",
> > > > > > > >     "code":500}}
> > > > > > > >
> > > > > > > >
> > > > > > > > but if i change nullpolicy to ignore or collapse
> > > > > > > >
> > > > > > > > no error happened.
> > > > > > > >
> > > > > > > >
> > > > > > > > and i wondered when i used pysolr to create  a more like this
> > > query
> > > > > > > >
> > > > > > > > i get above error again.
> > > > > > > >
> > > > > > > > so it seems nullpolicy=expand work me just in more like this
> > > query
> > > > in
> > > > > > > > solr web UI!!!!
> > > > > > > >
> > > > > > > > and my question is how to solve my problem to use
> > > nullpolicy=expand
> > > > > in
> > > > > > > > pysolr?
> > > > > > > >
> > > > > > > > tnx
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Reply via email to