Sure. So it is really simple. Following the Solr example for setting up two shards and pushing some xml docs to each one and then doing a distributed query (http://wiki.apache.org/solr/DistributedSearch), it works perfectly. Now in my case the indices are being built outside of Solr. So basically I create three sets of indices through Lucene API's. And at this point, I change the schema.xml and define the fields I have in these new indices. I launch three Solr apps (say on ports 7573, 7574, 7575) and host these indices under each of the instances. Now if I do a search on any of the Solr apps separately:
curl 'http://localhost:757[345]/solr/select/?distrib=true&indent=on&q=content:solar' I get results: <lst name="responseHeader"> <int name="status">0</int> <int name="QTime">59</int> <lst name="params"> <str name="indent">on</str> <str name="distrib">true</str> <str name="q">content:solar</str> </lst> </lst> <result name="response" numFound="6776" start="0"> <doc> ... </doc> <doc> ... </doc> ... </result> </response> But when I issue the following GET: curl 'http://localhost:7575/solr/select/?shards=localhost:7573/solr,localhost:7574/solr,localhost:7575/solr&distrib=true&indent=on&q=content:solar' This is what I get: <response> <lst name="responseHeader"> <int name="status">0</int> <int name="QTime">235</int> <lst name="params"> <str name="q">content:solar</str> <str name="indent">on</str> <str name="shards">localhost:7573/solr,localhost:7574/solr,localhost:7575/solr</str> <str name="distrib">true</str> </lst> </lst> <result name="response" numFound="20298" start="0"/> </response> As you can see the numFound says that there are documents but the documents are not part of the response. Now if I add "group.main=true&group=true&group.field=id" to the query string, then I get an NPE: <body> HTTP ERROR 500 <p>Problem accessing /solr/select/. Reason: <pre> null java.lang.NullPointerException at java.io.StringReader.<init>(StringReader.java:44) at org.apache.lucene.queryParser.QueryParser.parse(QueryParser.java:203) at org.apache.solr.search.LuceneQParser.parse(LuceneQParserPlugin.java:80) at org.apache.solr.search.QParser.getQuery(QParser.java:142) at org.apache.solr.handler.component.QueryComponent.prepare(QueryComponent.java:101) at org.apache.solr.handler.component.SearchHandler.handleRequestBody(SearchHandler.java:173) at org.apache.solr.handler.RequestHandlerBase.handleRequest(RequestHandlerBase.java:129) at org.apache.solr.core.SolrCore.execute(SolrCore.java:1372) at org.apache.solr.servlet.SolrDispatchFilter.execute(SolrDispatchFilter.java:356) at org.apache.solr.servlet.SolrDispatchFilter.doFilter(SolrDispatchFilter.java:252) at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1212) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:399) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:766) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:450) at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:230) at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:326) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:928) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404) at org.mortbay.jetty.bio.SocketConnector$Connection.run(SocketConnector.java:228) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582) </pre></p><hr />/<small>Powered by Jetty://</small>/<br/> So, the only thing that is different between the Solr sample and mine is that the indices have not been built through Solr itself but I believe that is a moot point anyway (I might be wrong here). But the fact that the individual queries to each instance do return the answer while the query with shards does not is a mystery to me. Thanks for the help. Ramin -- View this message in context: http://lucene.472066.n3.nabble.com/solr-shards-tp3691370p3694787.html Sent from the Solr - User mailing list archive at Nabble.com.
