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 saurish <sr...@gmail.com> on 2014/03/17 08:28:30 UTC

SolrCloud - CompositeId Document Routing Problem

Hi,I am testing the solrcloud's compositeId routing but failing to get
documents pertaining to a route. PFB the steps for the same. pls point where
i am making mistake in the configuration or let me know if i have to do
something more ....
I'm using zookeeper 3.4.5 and two tomcat 7 server instances with Solr 4.5. 

*Configured tomcat1,tomcat2 instances with solr home directories solr-home1
, solr-home2 respectively.Also copied solr config files to folder
/Users/solrconfig-files * 
*Uploaded Solr Configuration into Zookeeper ensemble :*
java -classpath .:/Users/solr-cli-lib/* org.apache.solr.cloud.ZkCLI -cmd
upconfig -zkhost localhost:2181 -confdir /Users/solrconfig-files -confname
myconf
java -classpath .:/Users/solr-cli-lib/* org.apache.solr.cloud.ZkCLI -cmd
linkconfig -collection collection1 -confname myconf -zkhost localhost:2181
 
*Deployed SolrCloud in Tomcat 7 :
placed below params in setenv.sh in both tomcats servers on different
machines.* 
SOLR_OPTS="-Dsolr.solr.home=/Users/solr-home1 -Dport=8080 -DhostContext=solr
-DzkClientTimeout=20000 -DzkHost=localhost:2181" 
(Note:- used the approprizate -DzkHost to point to the first node when
tomcat on second node starts)
JAVA_OPTS="$JAVA_OPTS $SOLR_OPTS"
 *Created solr.xml , placed in solr-home1 and solr-home2 content as below,*
<?xml version="1.0" encoding="UTF-8" ?>
        

*Creating Collection, shards and replicas, Using curl created collection *
/curl
'http://localhost:8080/solr/admin/collections?action=CREATE&name=collection1&router.name=compositeId&router.Id=id&numShards=2&replicationFactor=2&maxShardsPerNode=2'
/ 
*Created a collection collection1 with two shards with replicator 2 *
/curl
'http://localhost:8080/solr/admin/cores?action=CREATE&name=shard1-replica-1&collection=collection1&shard=shard1'/
/curl
'http://X.X.X.X:8080/solr/admin/cores?action=CREATE&name=shard1-replica-2&collection=collection1&shard=shard1'/ 
curl
'http://localhost:8080/solr/admin/cores?action=CREATE&name=shard2-replica-1&collection=collection1&shard=shard2'curl
'http://x.x.x.x:8080/solr/admin/cores?action=CREATE&name=shard2-replica-2&collection=collection1&shard=shard2' 

*Indexed few docs using curl as below ,*
curl http://localhost:8080/solr/update -H "Content-Type: text/xml"
--data-binary 'Sports!1234football'
 
curl http://localhost:8080/solr/update -H "Content-Type: text/xml"
--data-binary 'Movies!4321The.Shawshank.Redemption' 
*I am querying using the below syntax:*
/http://localhost:8080/solr/collection/select?q=*:*&_route_=Sports!&wt=json&indent=true/
/http://localhost:8080/solr/collection/select?q=*:*&_route_=Movies!&wt=json&indent=true/
 

On both the ocassions,  i end up results of "Sports" route only. If i given
_route_ paramter with any other name, still the results of "Sports" are
thrown up.
Can you pls point where am i making mistake?Regards



--
View this message in context: http://lucene.472066.n3.nabble.com/SolrCloud-CompositeId-Document-Routing-Problem-tp4124715.html
Sent from the Solr - User mailing list archive at Nabble.com.