Load existing Lucene sharded indexes onto single Solr collection
Folks, I have generated multiple (count of 100) sharded Lucene indexes on Hadoop and they are of format. The total indexed data (sum of all the index-*) is of size 500GB and hence the number of shards.drwxr-x--- 2 index-66drwxr-x--- 2 index-68drwxr-x--- 2 index-9 and each index directory is of formatls index-9_4.fdt _4.fdx _4.fnm _4_Lucene40_0.frq _4_Lucene40_0.prx _4_Lucene40_0.tim _4_Lucene40_0.tip _4_nrm.cfe _4_nrm.cfs _4.si segments_1 segments.gen write.lock Now to load this index, I am currently using Lucene IndexMergeTool to merge all the shards into one giant index. My question is, is there a way to load shared index without merging into one giant index on to single collection ? Thanks,Jaikit
Re: Load existing Lucene sharded indexes onto single Solr collection
This solution will merge the index as well. I want to find out if merge is "required" before loading indexes onto Solr ? If that is possible than I can just point solrconfig.xml to directory where I have all the shards. Jaikit On Wednesday, January 14, 2015 1:11 AM, Mikhail Khludnev wrote: On Wed, Jan 14, 2015 at 11:42 AM, Jaikit Savla wrote: Now to load this index, I am currently using Lucene IndexMergeTool to merge all the shards into one giant index. My question is, is there a way to load shared index without merging into one giant index on to single collection ? https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API#CoreAdminAPI-MERGEINDEXES ? -- Sincerely yours Mikhail Khludnev Principal Engineer, Grid Dynamics
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. 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:/solr/core0/select?shards=localhost:/solr/core1&q=title:amazon&fl=*&rows=10&wt=json RESPONSE: {"responseHeader":{"status":500,"QTime":11,"params":{"fl":"*","shards":"localhost:/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: Load existing Lucene sharded indexes onto single Solr collection
Yes, I wanted to get rid of merge step. But looks like merge is not that cumbersome either. Thanks Mikhail and Erick for pointers, that helped. Jaikit On Wednesday, January 14, 2015 8:24 AM, Erick Erickson wrote: You certainly can't do this into a single directory, there would be zillions of name conflicts. I believe I saw Uwe make a comment on the Lucene list about using MultiReaders and keeping the sub-indexes in different directories, but that's lower-level than Solr has access to Plus, you'd have to control index updates _very_ carefully. So I don't think there's something built into Solr to work with indexes like this, so merge is probably your only option here. Do note that the contrib MapReduceIndexerTool that will do most all of this for you, it includes a --go-live option. That option still copies things around though. Best, Erick On Wed, Jan 14, 2015 at 1:25 AM, Jaikit Savla wrote: > This solution will merge the index as well. I want to find out if merge is > "required" before loading indexes onto Solr ? If that is possible than I can > just point solrconfig.xml to directory where I have all the shards. > Jaikit > > On Wednesday, January 14, 2015 1:11 AM, Mikhail Khludnev > wrote: > > > > On Wed, Jan 14, 2015 at 11:42 AM, Jaikit Savla > wrote: > > Now to load this index, I am currently using Lucene IndexMergeTool to merge > all the shards into one giant index. My question is, is there a way to load > shared index without merging into one giant index on to single collection ? > > https://cwiki.apache.org/confluence/display/solr/CoreAdmin+API#CoreAdminAPI-MERGEINDEXES > ? > > > -- > Sincerely yours > Mikhail Khludnev > Principal Engineer, > Grid Dynamics > > > > >
Re: Distributed search across Solr cores in a collection - NPE
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 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. 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:/solr/core0/select?shards=localhost:/solr/core1&q=title:amazon&fl=*&rows=10&wt=json RESPONSE: {"responseHeader":{"status":500,"QTime":11,"params":{"fl":"*","shards":"localhost:/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
Distributed Search returns Empty document list
Hello, I am running Solr (4.10) in cloud mode by configuring multiple collections (1 for each day). Structure is as shown below. I can fetch documents for given query, if I query individual collection. However when I send distributed request to multiple shards, I only see numFound and no documents returned. Appreciate any pointers on setup. --- directory structure:solrcollection1 //(does not have any index)collection_20150112collection_20150113 Command to run Solr:sh bin/solr restart -d example -cloud -p -noprompt Set up RequestHandler called alias in solrconfig.xml of collecton1 explicit json true text score,* http://localhost:/solr/collection_20150113,http://localhost:/solr/collection_20150112 http://localhost:/solr/collection1/alias?q=domain:com&debug=false&shard.info=true e.g{ - responseHeader: { - status: 0, - QTime: 19, - params: { - q: "domain:com", - debug: "false", - shard.info: "true" } }, - response: { - numFound: 11696, - start: 0, - maxScore: 1.3015664, - docs: [ ] } } Thanks
Solr numFound > 0 but doc list empty in Solr Cloud setup
I am using below tutorial for Solr Cloud setup with 2 shards http://wiki.apache.org/solr/SolrCloud#Example_A:_Simple_two_shard_cluster I am able to get the default set up working. However, I have a requirement where my index is not in default location (data/index) and hence when I start jvm for each shard I run with -Dsolr.data.dir= . Now when I query I get results with numFound > 0 but doc list is always empty. I verified that my index does have fields stored and indexed. Anyone else faced similar issue or have an idea on what I am missing ? Verified that by loading single core. Appreciate any help. request: http://localhost:/solr/collection1/select?q=body%3A%22to%22&wt=json&indent=true&shards=http://localhost:/solr/collection1 response: { "responseHeader": { "status": 0, "QTime": 18, "params": { "shards": "http://localhost:/solr/collection1";, "indent": "true", "q": "body:\"to\"", "_": "1421390858638", "wt": "json" } }, "response": { "numFound": 2564, "start": 0, "maxScore": 0.4523638, "docs": [] } }
Re: Solr numFound > 0 but doc list empty in Solr Cloud setup
Verified that all my fields are stored and marked as indexed. --> http://localhost:/solr/collection1/query?q=body%3A%22from%22&wt=json&indent=true&shards=http://localhost:/solr/collection1&start=1&rows=10&shards.info=true { responseHeader: { status: 0, QTime: 19, params: { shards: "http://localhost:/solr/collection1";, indent: "true", start: "1", q: "body:"from"", shards.info: "true", wt: "json", rows: "10" } }, shards.info: { http://localhost:/solr/collection1: { numFound: 1717, maxScore: 0.5327856, shardAddress: "http://localhost:/solr/collection1";, time: 12 } }, response: { numFound: 1707, start: 1, maxScore: 0.5327856, docs: [ ] } } On Friday, January 16, 2015 9:56 AM, Erick Erickson wrote: Any chance that you've defined &rows=0 in your handler? Or is it possible that you have not set stored="true" for any of your fields? Best, Erick On Fri, Jan 16, 2015 at 9:46 AM, Jaikit Savla wrote: > I am using below tutorial for Solr Cloud setup with 2 shards > http://wiki.apache.org/solr/SolrCloud#Example_A:_Simple_two_shard_cluster > > > I am able to get the default set up working. However, I have a requirement > where my index is not in default location (data/index) and hence when I start > jvm for each shard I run with -Dsolr.data.dir= . Now when > I query I get results with numFound > 0 but doc list is always empty. > > I verified that my index does have fields stored and indexed. Anyone else > faced similar issue or have an idea on what I am missing ? Verified that by > loading single core. > > Appreciate any help. > > request: > > http://localhost:/solr/collection1/select?q=body%3A%22to%22&wt=json&indent=true&shards=http://localhost:/solr/collection1 > > > response: > { "responseHeader": { "status": 0, "QTime": 18, "params": { "shards": > "http://localhost:/solr/collection1";, "indent": "true", "q": > "body:\"to\"", "_": "1421390858638", "wt": "json" } }, "response": { > "numFound": 2564, "start": 0, "maxScore": 0.4523638, "docs": [] } }
Re: Solr numFound > 0 but doc list empty in Solr Cloud setup
As I said earlier - single core set up works fine with same solrconfig.xml and schema.xml cd example java -Djetty.port= -Dsolr.data.dir=/index/path -jar start.jar I am running Solr-4.10. Do I need to change any other configuration for running in solr cloud mode ? On Friday, January 16, 2015 11:56 AM, Jaikit Savla wrote: Verified that all my fields are stored and marked as indexed. --> http://localhost:/solr/collection1/query?q=body%3A%22from%22&wt=json&indent=true&shards=http://localhost:/solr/collection1&start=1&rows=10&shards.info=true { responseHeader: { status: 0, QTime: 19, params: { shards: "http://localhost:/solr/collection1";, indent: "true", start: "1", q: "body:"from"", shards.info: "true", wt: "json", rows: "10" } }, shards.info: { http://localhost:/solr/collection1: { numFound: 1717, maxScore: 0.5327856, shardAddress: "http://localhost:/solr/collection1";, time: 12 } }, response: { numFound: 1707, start: 1, maxScore: 0.5327856, docs: [ ] } } On Friday, January 16, 2015 9:56 AM, Erick Erickson wrote: Any chance that you've defined &rows=0 in your handler? Or is it possible that you have not set stored="true" for any of your fields? Best, Erick On Fri, Jan 16, 2015 at 9:46 AM, Jaikit Savla wrote: > I am using below tutorial for Solr Cloud setup with 2 shards > http://wiki.apache.org/solr/SolrCloud#Example_A:_Simple_two_shard_cluster > > > I am able to get the default set up working. However, I have a requirement > where my index is not in default location (data/index) and hence when I start > jvm for each shard I run with -Dsolr.data.dir= . Now when > I query I get results with numFound > 0 but doc list is always empty. > > I verified that my index does have fields stored and indexed. Anyone else > faced similar issue or have an idea on what I am missing ? Verified that by > loading single core. > > Appreciate any help. > > request: > > http://localhost:/solr/collection1/select?q=body%3A%22to%22&wt=json&indent=true&shards=http://localhost:/solr/collection1 > > > response: > { "responseHeader": { "status": 0, "QTime": 18, "params": { "shards": > "http://localhost:/solr/collection1";, "indent": "true", "q": > "body:\"to\"", "_": "1421390858638", "wt": "json" } }, "response": { > "numFound": 2564, "start": 0, "maxScore": 0.4523638, "docs": [] } }
Re: Solr numFound > 0 but doc list empty in Solr Cloud setup
One more point: In cloud mode: If I submit a request with fl=id, it returns doc list. But when I add any other field, I get an empty doc list. http://localhost:/solr/select?q=domain:ebay&wt=json&shards=http://localhost:/solr/&fl=id&rows=1 { responseHeader: { status: 0, QTime: 7, params: { fl: "id", shards: "http://localhost:/solr/";, q: "domain:ebay", wt: "json", rows: "1" } }, response: { numFound: 17, start: 0, maxScore: 3.8559604, docs: [ { id: "d8406557-6cd8-46d9-9a5e-29844387afc4" } ] } } Note: all of above works in single core mode. On Friday, January 16, 2015 12:13 PM, Jaikit Savla wrote: As I said earlier - single core set up works fine with same solrconfig.xml and schema.xml cd example java -Djetty.port= -Dsolr.data.dir=/index/path -jar start.jar I am running Solr-4.10. Do I need to change any other configuration for running in solr cloud mode ? On Friday, January 16, 2015 11:56 AM, Jaikit Savla wrote: Verified that all my fields are stored and marked as indexed. --> http://localhost:/solr/collection1/query?q=body%3A%22from%22&wt=json&indent=true&shards=http://localhost:/solr/collection1&start=1&rows=10&shards.info=true { responseHeader: { status: 0, QTime: 19, params: { shards: "http://localhost:/solr/collection1";, indent: "true", start: "1", q: "body:"from"", shards.info: "true", wt: "json", rows: "10" } }, shards.info: { http://localhost:/solr/collection1: { numFound: 1717, maxScore: 0.5327856, shardAddress: "http://localhost:/solr/collection1";, time: 12 } }, response: { numFound: 1707, start: 1, maxScore: 0.5327856, docs: [ ] } } On Friday, January 16, 2015 9:56 AM, Erick Erickson wrote: Any chance that you've defined &rows=0 in your handler? Or is it possible that you have not set stored="true" for any of your fields? Best, Erick On Fri, Jan 16, 2015 at 9:46 AM, Jaikit Savla wrote: > I am using below tutorial for Solr Cloud setup with 2 shards > http://wiki.apache.org/solr/SolrCloud#Example_A:_Simple_two_shard_cluster > > > I am able to get the default set up working. However, I have a requirement > where my index is not in default location (data/index) and hence when I start > jvm for each shard I run with -Dsolr.data.dir= . Now when > I query I get results with numFound > 0 but doc list is always empty. > > I verified that my index does have fields stored and indexed. Anyone else > faced similar issue or have an idea on what I am missing ? Verified that by > loading single core. > > Appreciate any help. > > request: > > http://localhost:/solr/collection1/select?q=body%3A%22to%22&wt=json&indent=true&shards=http://localhost:/solr/collection1 > > > response: > { "responseHeader": { "status": 0, "QTime": 18, "params": { "shards": > "http://localhost:/solr/collection1";, "indent": "true", "q": > "body:\"to\"", "_": "1421390858638", "wt": "json" } }, "response": { > "numFound": 2564, "start": 0, "maxScore": 0.4523638, "docs": [] } }
Re: Solr numFound > 0 but doc list empty in Solr Cloud setup
I followed all the steps listed here: http://wiki.apache.org/solr/SolrCloud#Example_A:_Simple_two_shard_cluster I have not updated solrconfig.xml and it is same as what comes default with 4.10. The only thing I added extra was list of my fields in example/solr/collection1/conf/schema.xml @shards: If I query with out that param, it returns below error: http://localhost:/solr/collection1/select?q=*:* 503 3 *:* no servers hosting shard: 503 On Friday, January 16, 2015 12:37 PM, Anshum Gupta wrote: Looks like a config issue to me more than anything else. Can you share your solrconfig? You will not be able to attach a file here but you could share it via pastebin or something similar. Also, why are you adding the "shards=http://localhost:8983/solr/collection1"; part to your request? You don't need to do that in most cases. On Fri, Jan 16, 2015 at 12:20 PM, Jaikit Savla < jaikit.sa...@yahoo.com.invalid> wrote: > One more point: > In cloud mode: If I submit a request with fl=id, it returns doc list. But > when I add any other field, I get an empty doc list. > > > http://localhost:/solr/select?q=domain:ebay&wt=json&shards=http://localhost:/solr/&fl=id&rows=1 > > { > responseHeader: { > status: 0, > QTime: 7, > params: { > fl: "id", > shards: "http://localhost:/solr/";, > q: "domain:ebay", > wt: "json", > rows: "1" > } > }, > response: { > numFound: 17, > start: 0, > maxScore: 3.8559604, > docs: [ > { > id: "d8406557-6cd8-46d9-9a5e-29844387afc4" > } > ] > } > } > > > Note: all of above works in single core mode. > > > > On Friday, January 16, 2015 12:13 PM, Jaikit Savla > wrote: > As I said earlier - single core set up works fine with same solrconfig.xml > and schema.xml > > cd example > java -Djetty.port= -Dsolr.data.dir=/index/path -jar start.jar > > I am running Solr-4.10. Do I need to change any other configuration for > running in solr cloud mode ? > > > > > On Friday, January 16, 2015 11:56 AM, Jaikit Savla > wrote: > Verified that all my fields are stored and marked as indexed. > multiValued="true" /> > > > > --> > > http://localhost:/solr/collection1/query?q=body%3A%22from%22&wt=json&indent=true&shards=http://localhost:/solr/collection1&start=1&rows=10&shards.info=true > > { > responseHeader: { > status: 0, > QTime: 19, > params: { > shards: "http://localhost:/solr/collection1";, > indent: "true", > start: "1", > q: "body:"from"", > shards.info: "true", > wt: "json", > rows: "10" > } > }, > shards.info: { > http://localhost:/solr/collection1: { > numFound: 1717, > maxScore: 0.5327856, > shardAddress: "http://localhost:/solr/collection1";, > time: 12 > } > }, > response: { > numFound: 1707, > start: 1, > maxScore: 0.5327856, > docs: [ ] > } > } > > > > > On Friday, January 16, 2015 9:56 AM, Erick Erickson < > erickerick...@gmail.com> wrote: > Any chance that you've defined &rows=0 in your handler? Or is it possible > that you have not set stored="true" for any of your fields? > > Best, > Erick > > > On Fri, Jan 16, 2015 at 9:46 AM, Jaikit Savla > wrote: > > I am using below tutorial for Solr Cloud setup with 2 shards > > > http://wiki.apache.org/solr/SolrCloud#Example_A:_Simple_two_shard_cluster > > > > > > I am able to get the default set up working. However, I have a > requirement where my index is not in default location (data/index) and > hence when I start jvm for each shard I run with -Dsolr.data.dir= index path> . Now when I query I get results with numFound > 0 but doc list > is always empty. > > > > I verified that my index does have fields stored and indexed. Anyone > else faced similar issue or have an idea on what I am missing ? Verified > that by loading single core. > > > > Appreciate any help. > > > > request: > > > > > http://localhost:/solr/collection1/select?q=body%3A%22to%22&wt=json&indent=true&shards=http://localhost:/solr/collection1 > > > > > > response: > > { "responseHeader": { "status": 0, "QTime": 18, "params": { "shards": " > http://localhost:/solr/collection1";, "indent": "true", "q": > "body:\"to\"", "_": "1421390858638", "wt": "json" } }, "response": { > "numFound": 2564, "start": 0, "maxScore": 0.4523638, "docs": [] } } > -- Anshum Gupta http://about.me/anshumgupta
Re: Solr numFound > 0 but doc list empty in Solr Cloud setup
Anshuman, You are right about @shards param not required. One of my shard was down and hence when I added &shards.tolerant=true, it worked without shards param. However document list is still empty. content of solrconfig.xml http://pastebin.com/CJxD22t1 On Friday, January 16, 2015 1:24 PM, Jaikit Savla wrote: I followed all the steps listed here: http://wiki.apache.org/solr/SolrCloud#Example_A:_Simple_two_shard_cluster I have not updated solrconfig.xml and it is same as what comes default with 4.10. The only thing I added extra was list of my fields in example/solr/collection1/conf/schema.xml @shards: If I query with out that param, it returns below error: http://localhost:/solr/collection1/select?q=*:* 503 3 *:* no servers hosting shard: 503 On Friday, January 16, 2015 12:37 PM, Anshum Gupta wrote: Looks like a config issue to me more than anything else. Can you share your solrconfig? You will not be able to attach a file here but you could share it via pastebin or something similar. Also, why are you adding the "shards=http://localhost:8983/solr/collection1"; part to your request? You don't need to do that in most cases. On Fri, Jan 16, 2015 at 12:20 PM, Jaikit Savla < jaikit.sa...@yahoo.com.invalid> wrote: > One more point: > In cloud mode: If I submit a request with fl=id, it returns doc list. But > when I add any other field, I get an empty doc list. > > > http://localhost:/solr/select?q=domain:ebay&wt=json&shards=http://localhost:/solr/&fl=id&rows=1 > > { > responseHeader: { > status: 0, > QTime: 7, > params: { > fl: "id", > shards: "http://localhost:/solr/";, > q: "domain:ebay", > wt: "json", > rows: "1" > } > }, > response: { > numFound: 17, > start: 0, > maxScore: 3.8559604, > docs: [ > { > id: "d8406557-6cd8-46d9-9a5e-29844387afc4" > } > ] > } > } > > > Note: all of above works in single core mode. > > > > On Friday, January 16, 2015 12:13 PM, Jaikit Savla > wrote: > As I said earlier - single core set up works fine with same solrconfig.xml > and schema.xml > > cd example > java -Djetty.port= -Dsolr.data.dir=/index/path -jar start.jar > > I am running Solr-4.10. Do I need to change any other configuration for > running in solr cloud mode ? > > > > > On Friday, January 16, 2015 11:56 AM, Jaikit Savla > wrote: > Verified that all my fields are stored and marked as indexed. > multiValued="true" /> > > > > --> > > http://localhost:/solr/collection1/query?q=body%3A%22from%22&wt=json&indent=true&shards=http://localhost:/solr/collection1&start=1&rows=10&shards.info=true > > { > responseHeader: { > status: 0, > QTime: 19, > params: { > shards: "http://localhost:/solr/collection1";, > indent: "true", > start: "1", > q: "body:"from"", > shards.info: "true", > wt: "json", > rows: "10" > } > }, > shards.info: { > http://localhost:/solr/collection1: { > numFound: 1717, > maxScore: 0.5327856, > shardAddress: "http://localhost:/solr/collection1";, > time: 12 > } > }, > response: { > numFound: 1707, > start: 1, > maxScore: 0.5327856, > docs: [ ] > } > } > > > > > On Friday, January 16, 2015 9:56 AM, Erick Erickson < > erickerick...@gmail.com> wrote: > Any chance that you've defined &rows=0 in your handler? Or is it possible > that you have not set stored="true" for any of your fields? > > Best, > Erick > > > On Fri, Jan 16, 2015 at 9:46 AM, Jaikit Savla > wrote: > > I am using below tutorial for Solr Cloud setup with 2 shards > > > http://wiki.apache.org/solr/SolrCloud#Example_A:_Simple_two_shard_cluster > > > > > > I am able to get the default set up working. However, I have a > requirement where my index is not in default location (data/index) and > hence when I start jvm for each shard I run with -Dsolr.data.dir= index path> . Now when I query I get results with numFound > 0 but doc list > is always empty. > > > > I verified that my index does have fields stored and indexed. Anyone > else faced similar issue or have an idea on what I am missing ? Verified > that by loading single core. > > > > Appreciate any help. > > > > request: > > > > > http://localhost:/solr/collection1/select?q=body%3A%22to%22&wt=json&indent=true&shards=http://localhost:/solr/collection1 > > > > > > response: > > { "responseHeader": { "status": 0, "QTime": 18, "params": { "shards": " > http://localhost:/solr/collection1";, "indent": "true", "q": > "body:\"to\"", "_": "1421390858638", "wt": "json" } }, "response": { > "numFound": 2564, "start": 0, "maxScore": 0.4523638, "docs": [] } } > -- Anshum Gupta http://about.me/anshumgupta