On 8/1/2018 12:59 AM, Nicolas Franck wrote:
@Mikhail Khludnev: thanks for your response
You mean something like this (source collection is "collection1", and
I want to query "collection2"):
SolrClient solrClient = new EmbeddedSolrServer(req.getCore());
ModifiableSolrParams newParams = new ModifiableSolrParams();
newParams.add("collection","collection2");
SolrDocumentList docs = solrClient.getById(ids, newParams);
which is basically the same as:
http://localhost:8983/collection1_shard1_replica_n1/select?collection=collection2&&qt=/get&ids=myid
An instance of EmbeddedSolrServer has no http access. Also, it can't do
SolrCloud -- because SolrCloud requires http. EmbeddedSolrServer is a
complete Solr server running in standalone (not cloud) mode, without
http access.
If you're doing this code within a Solr plugin, then you can't start an
EmbeddedSolrServer on one of the cores from the Solr install. Any cores
you try to use will already be open, so the embedded server will not be
able to open them. Since you're already running inside a Solr server,
there's no reason to start *another* Solr server.
I don't have any other ideas for you. I've written a couple of update
processors for Solr, but nothing that does queries.
but in both cases, I get this error:
org.apache.solr.common.SolrException: Can't find shard
'collection1_shard1' at
org.apache.solr.handler.component.RealTimeGetComponent.sliceToShards(RealTimeGetComponent.java:897)
at
apparently it forgets its own cloud information? What am I missing here?
As already mentioned, EmbeddedSolrServer can't do SolrCloud.
Thanks,
Shawn
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]