You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Jaikit Savla <ja...@yahoo.com.INVALID> on 2015/01/14 10:53:35 UTC

Distributed search across Solr cores in a collection - NPE

Folks,
I have set up 3 cores in a single collection and they all have same schema but different index. I have set unique Id required field to false.<field name="id" type="string" indexed="true" stored="true" required="false"/>
When I run query against single core, it works fine. But when I add the shard param and point to different core than request fails with NPE. I looked up on the source code for QueryComponent and line 1043 isresultIds.put(shardDoc.id.toString(), shardDoc);
looks like the the shardDoc id.toString() is throwing NPE.http://grepcode.com/file/repo1.maven.org/maven2/org.apache.solr/solr-core/4.10.1/org/apache/solr/handler/component/QueryComponent.java#QueryComponent.mergeIds%28org.apache.solr.handler.component.ResponseBuilder%2Corg.apache.solr.handler.component.ShardRequest%29
Any clue on if my set up is incorrect ?

 http://localhost:9999/solr/core0/select?shards=localhost:9999/solr/core1&q=title:amazon&fl=*&rows=10&wt=json

RESPONSE:   {"responseHeader":{"status":500,"QTime":11,"params":{"fl":"*","shards":"localhost:9999/solr/core1","q":"domain:amazon","wt":"json","rows":"10"}},"error":{"trace":"java.lang.NullPointerException\n\tat org.apache.solr.handler.component.QueryComponent.mergeIds(QueryComponent.java:1043)\n\tat org.apache.solr.handler.component.QueryComponent.handleRegularResponses(QueryComponent.java:716)\n\tat org.apache.solr.handler.component.QueryComponent.handleResponses(QueryComponent.java:695)\n\tat org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:324)\n\tat org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)\n\tat org.apache.solr.core.SolrCore.execute(SolrCore.java:1967)\n\tat org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:777)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:418)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:368)\n\tat org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)\n\tat org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)\n\tat org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)\n\tat org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)\n\tat org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)\n\tat org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)\n\tat org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)\n\tat org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)\n\tat java.lang.Thread.run(Thread.java:745)\n","code":500}}
Appreciate any pointers.
Thanks,Jaikit

Re: Distributed search across Solr cores in a collection - NPE

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
Jaikit,
uniq key is mandatory for distributed search. if most of your docs have ids
assigned, you can drop remaining ones by adding something like ..&fq=id:[*
TO *]

On Wed, Jan 14, 2015 at 12:53 PM, Jaikit Savla <
jaikit.savla@yahoo.com.invalid> wrote:

> Folks,
> I have set up 3 cores in a single collection and they all have same schema
> but different index. I have set unique Id required field to false.<field
> name="id" type="string" indexed="true" stored="true" required="false"/>
> When I run query against single core, it works fine. But when I add the
> shard param and point to different core than request fails with NPE. I
> looked up on the source code for QueryComponent and line 1043
> isresultIds.put(shardDoc.id.toString(), shardDoc);
> looks like the the shardDoc id.toString() is throwing NPE.
> http://grepcode.com/file/repo1.maven.org/maven2/org.apache.solr/solr-core/4.10.1/org/apache/solr/handler/component/QueryComponent.java#QueryComponent.mergeIds%28org.apache.solr.handler.component.ResponseBuilder%2Corg.apache.solr.handler.component.ShardRequest%29
> Any clue on if my set up is incorrect ?
>
>
> http://localhost:9999/solr/core0/select?shards=localhost:9999/solr/core1&q=title:amazon&fl=*&rows=10&wt=json
>
> RESPONSE:
>  {"responseHeader":{"status":500,"QTime":11,"params":{"fl":"*","shards":"localhost:9999/solr/core1","q":"domain:amazon","wt":"json","rows":"10"}},"error":{"trace":"java.lang.NullPointerException\n\tat
> org.apache.solr.handler.component.QueryComponent.mergeIds(QueryComponent.java:1043)\n\tat
> org.apache.solr.handler.component.QueryComponent.handleRegularResponses(QueryComponent.java:716)\n\tat
> org.apache.solr.handler.component.QueryComponent.handleResponses(QueryComponent.java:695)\n\tat
> org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:324)\n\tat
> org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)\n\tat
> org.apache.solr.core.SolrCore.execute(SolrCore.java:1967)\n\tat
> org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:777)\n\tat
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:418)\n\tat
> org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207)\n\tat
> org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)\n\tat
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)\n\tat
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)\n\tat
> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)\n\tat
> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)\n\tat
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)\n\tat
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)\n\tat
> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)\n\tat
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)\n\tat
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)\n\tat
> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)\n\tat
> org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)\n\tat
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)\n\tat
> org.eclipse.jetty.server.Server.handle(Server.java:368)\n\tat
> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)\n\tat
> org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)\n\tat
> org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)\n\tat
> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)\n\tat
> org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)\n\tat
> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)\n\tat
> org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)\n\tat
> org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)\n\tat
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)\n\tat
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)\n\tat
> java.lang.Thread.run(Thread.java:745)\n","code":500}}
> Appreciate any pointers.
> Thanks,Jaikit
>



-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>

Re: Distributed search across Solr cores in a collection - NPE

Posted by Jaikit Savla <ja...@yahoo.com.INVALID>.
It was because I did not have unique id's in my index. I added that and it worked. Also it is mentioned as one of the requirement for Distributed Search.
Thanks,Jaikit

 

     On Wednesday, January 14, 2015 1:53 AM, Jaikit Savla <ja...@yahoo.com> wrote:
   

 Folks,
I have set up 3 cores in a single collection and they all have same schema but different index. I have set unique Id required field to false.<field name="id" type="string" indexed="true" stored="true" required="false"/>
When I run query against single core, it works fine. But when I add the shard param and point to different core than request fails with NPE. I looked up on the source code for QueryComponent and line 1043 isresultIds.put(shardDoc.id.toString(), shardDoc);
looks like the the shardDoc id.toString() is throwing NPE.http://grepcode.com/file/repo1.maven.org/maven2/org.apache.solr/solr-core/4.10.1/org/apache/solr/handler/component/QueryComponent.java#QueryComponent.mergeIds%28org.apache.solr.handler.component.ResponseBuilder%2Corg.apache.solr.handler.component.ShardRequest%29
Any clue on if my set up is incorrect ?

 http://localhost:9999/solr/core0/select?shards=localhost:9999/solr/core1&q=title:amazon&fl=*&rows=10&wt=json

RESPONSE:   {"responseHeader":{"status":500,"QTime":11,"params":{"fl":"*","shards":"localhost:9999/solr/core1","q":"domain:amazon","wt":"json","rows":"10"}},"error":{"trace":"java.lang.NullPointerException\n\tat org.apache.solr.handler.component.QueryComponent.mergeIds(QueryComponent.java:1043)\n\tat org.apache.solr.handler.component.QueryComponent.handleRegularResponses(QueryComponent.java:716)\n\tat org.apache.solr.handler.component.QueryComponent.handleResponses(QueryComponent.java:695)\n\tat org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:324)\n\tat org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:135)\n\tat org.apache.solr.core.SolrCore.execute(SolrCore.java:1967)\n\tat org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:777)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:418)\n\tat org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:207)\n\tat org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1419)\n\tat org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:455)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)\n\tat org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)\n\tat org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)\n\tat org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)\n\tat org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)\n\tat org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)\n\tat org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)\n\tat org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)\n\tat org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:154)\n\tat org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)\n\tat org.eclipse.jetty.server.Server.handle(Server.java:368)\n\tat org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)\n\tat org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)\n\tat org.eclipse.jetty.server.AbstractHttpConnection.headerComplete(AbstractHttpConnection.java:942)\n\tat org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.headerComplete(AbstractHttpConnection.java:1004)\n\tat org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:640)\n\tat org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:235)\n\tat org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)\n\tat org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)\n\tat org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)\n\tat java.lang.Thread.run(Thread.java:745)\n","code":500}}
Appreciate any pointers.
Thanks,Jaikit