[jira] [Commented] (SOLR-10885) NullPointerException when run collapse filter

2017-11-17 Thread Varun Thacker (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-10885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16257873#comment-16257873
 ] 

Varun Thacker commented on SOLR-10885:
--

Makes sense . I'll add some wording. Thanks for reporting

> NullPointerException when run collapse filter 
> --
>
> Key: SOLR-10885
> URL: https://issues.apache.org/jira/browse/SOLR-10885
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: search
>Affects Versions: 6.4.1
>Reporter: jefferyyuan
>Assignee: Varun Thacker
>Priority: Critical
>
> Solr collapse is a great function to collapse data that is related so we only 
> show one in search result.
> Just found one issue related with it - It throw NullPointerException in some 
> cases.
> To reproduce it, first ingest some data - AND commit multiple times.
> 1. When there is no data that matches the query:
> http://localhost:8983/solr/thecollection/select?defType=edismax=non-existType:*={!collapse
>  field=seriesId nullPolicy=expand}={!collapse field=programId 
> nullPolicy=expand}
> - But the problem only happens if I use both collapse fqs, if I just use one 
> of them, it would be fine.
> *2. When the data that matches the query doesn't have the collapse fields
> - This is kind of a big problem as we may store different kinds of docs in 
> one collection, one query may match different kinds of docs. 
> If some docs (docType1) have same value for  field1, we want to collapse 
> them, if other dosc(docType2) have some value for field2, do same things.*
> - channel data doesn't have seriesId or programId
> http://localhost:8983/solr/thecollection/select?defType=edismax=docType:channel={!collapse
>  field=seriesId nullPolicy=expand}={!collapse field=programId 
> nullPolicy=expand}
> - But the problem only happens if I use both collapse fqs, if I just use one 
> of them, it would be fine.
> Exception from log:
> Caused by: 
> org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error 
> from server at http://localhost:8983/solr/searchItems_shard1_replica3: 
> java.lang.NullPointerException
>   at 
> org.apache.solr.search.CollapsingQParserPlugin$OrdScoreCollector.finish(CollapsingQParserPlugin.java:617)
>   at 
> org.apache.solr.search.CollapsingQParserPlugin$OrdScoreCollector.finish(CollapsingQParserPlugin.java:667)
>   at 
> org.apache.solr.search.SolrIndexSearcher.buildAndRunCollectorChain(SolrIndexSearcher.java:256)
>   at 
> org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1823)
>   at 
> org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1640)
>   at 
> org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:611)
>   at 
> org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:533)
>   at 
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:295)
>   at 
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:166)
>   at org.apache.solr.core.SolrCore.execute(SolrCore.java:2299)
>   at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:658)
>   at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:464)
>   at 
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:345)
>   at 
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:296)
>   at 
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1691)
>   at 
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
>   at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
>   at 
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
>   at 
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
>   at 
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
>   at 
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
>   at 
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
>   at 
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
>   at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>   at 
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
>   at 
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
>   at 
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:134)
> int nextDocBase = currentContext + 1 < this.contexts.length ? 
> 

[jira] [Commented] (SOLR-10885) NullPointerException when run collapse filter

2017-11-17 Thread jefferyyuan (JIRA)

[ 
https://issues.apache.org/jira/browse/SOLR-10885?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=16257855#comment-16257855
 ] 

jefferyyuan commented on SOLR-10885:


Thanks, It make senses.
Could we update the doc to explicitly state that: The collapse parser only 
supports collapsing on one field.
- This can avoid others to misuse it and later wonder why it doesn't work. 

> NullPointerException when run collapse filter 
> --
>
> Key: SOLR-10885
> URL: https://issues.apache.org/jira/browse/SOLR-10885
> Project: Solr
>  Issue Type: Bug
>  Security Level: Public(Default Security Level. Issues are Public) 
>  Components: search
>Affects Versions: 6.4.1
>Reporter: jefferyyuan
>Assignee: Varun Thacker
>Priority: Critical
>
> Solr collapse is a great function to collapse data that is related so we only 
> show one in search result.
> Just found one issue related with it - It throw NullPointerException in some 
> cases.
> To reproduce it, first ingest some data - AND commit multiple times.
> 1. When there is no data that matches the query:
> http://localhost:8983/solr/thecollection/select?defType=edismax=non-existType:*={!collapse
>  field=seriesId nullPolicy=expand}={!collapse field=programId 
> nullPolicy=expand}
> - But the problem only happens if I use both collapse fqs, if I just use one 
> of them, it would be fine.
> *2. When the data that matches the query doesn't have the collapse fields
> - This is kind of a big problem as we may store different kinds of docs in 
> one collection, one query may match different kinds of docs. 
> If some docs (docType1) have same value for  field1, we want to collapse 
> them, if other dosc(docType2) have some value for field2, do same things.*
> - channel data doesn't have seriesId or programId
> http://localhost:8983/solr/thecollection/select?defType=edismax=docType:channel={!collapse
>  field=seriesId nullPolicy=expand}={!collapse field=programId 
> nullPolicy=expand}
> - But the problem only happens if I use both collapse fqs, if I just use one 
> of them, it would be fine.
> Exception from log:
> Caused by: 
> org.apache.solr.client.solrj.impl.HttpSolrClient$RemoteSolrException: Error 
> from server at http://localhost:8983/solr/searchItems_shard1_replica3: 
> java.lang.NullPointerException
>   at 
> org.apache.solr.search.CollapsingQParserPlugin$OrdScoreCollector.finish(CollapsingQParserPlugin.java:617)
>   at 
> org.apache.solr.search.CollapsingQParserPlugin$OrdScoreCollector.finish(CollapsingQParserPlugin.java:667)
>   at 
> org.apache.solr.search.SolrIndexSearcher.buildAndRunCollectorChain(SolrIndexSearcher.java:256)
>   at 
> org.apache.solr.search.SolrIndexSearcher.getDocListNC(SolrIndexSearcher.java:1823)
>   at 
> org.apache.solr.search.SolrIndexSearcher.getDocListC(SolrIndexSearcher.java:1640)
>   at 
> org.apache.solr.search.SolrIndexSearcher.search(SolrIndexSearcher.java:611)
>   at 
> org.apache.solr.handler.component.QueryComponent.process(QueryComponent.java:533)
>   at 
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:295)
>   at 
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:166)
>   at org.apache.solr.core.SolrCore.execute(SolrCore.java:2299)
>   at org.apache.solr.servlet.HttpSolrCall.execute(HttpSolrCall.java:658)
>   at org.apache.solr.servlet.HttpSolrCall.call(HttpSolrCall.java:464)
>   at 
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:345)
>   at 
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:296)
>   at 
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1691)
>   at 
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:582)
>   at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
>   at 
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
>   at 
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:226)
>   at 
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1180)
>   at 
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:512)
>   at 
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
>   at 
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1112)
>   at 
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>   at 
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:213)
>   at 
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:119)
>   at 
>