On 6/8/2016 11:44 PM, Naveen Pajjuri wrote:
> Trying to migrate from HttpSolrServer to CloudSolrServer. getting the
> following exception while adding docs using CloudSolrServer.
>
>
> org.apache.solr.common.SolrException: Unknown document router
> '{name=compositeId}'
>
> at org.apache.solr.common.cloud.DocRouter.getDocRouter(DocRouter.java:46)
>
> whereas my cluterstate json says --
>
>   "maxShardsPerNode":"1",
>     "router":{"name":"compositeId"},
>     "replicationFactor":"1".

I am guessing that you are using a much older version of SolrJ than the
Solr version it is talking to.  The '{"name":"compositeId"}' structure
appears to be the way that newer versions of Solr record the router in
zookeeper, which is something that the older versions of SolrJ will not
know how to handle.

Mixing different versions of Solr and SolrJ will work very well, as long
as you're not using the cloud client.  That client is so tightly coupled
to SolrCloud internals that it does not work well with a large version
difference, especially if the client is older than the server.

Most likely you'll need to upgrade your SolrJ version.  At the same
time, switching to CloudSolrClient is probably a good idea -- the class
names that end in Server are deprecated in 5.x and gone in 6.x.

Thanks,
Shawn

Reply via email to