Hi All,
I am running solr in cloud mode in local with 2 shards and 2 replica on
port 8983 and 7574 and figuring out how to insert document in to a
particular shard , I read about implicit and composite route but i don't
think it will work for my usecase.

shard1 :  http://192.168.0.112:8983/family_shard1_replica_n1
 http://192.168.0.112:7574/family_shard1_replica_n2

shard2:   http://192.168.0.112:8983/family_shard2_replica_n3
 http://192.168.0.112:7574/family_shard2_replica_n4

we have documents with parent child relationship but flatten out with 2
levels down and reference to each other.
family schema documents:
{
"Id":"1"
"document_type":"parent"
"name":"John"
}
{
"Id":"2"
"document_type":"child"
"parentId":"1"
"name":"Rodney"
}
{
"Id":"3"
"document_type":"child"
"parentId":"1"
"name":"George"
}
{
"Id":"4"
"document_type":"grandchild"
"parentId":"1",
"childIdId":"2"
"name":"David"
}
we have complex queries to get data based on graph query parser and  as
graph query parser does not work on solr cloud with multiple shards. I was
trying to develop a logic like whenever a document gets inserted or updated
make sure it gets saved in the same shard where the parent doc is stored ,
in that way graph query works because all the family information will be in
the same shard.
Approach :
1) If a new child/grandchild is getting inserted then get the parent doc
shard details and add the shard details to the document in a field
ex:parentshard and save the doc in the shard.
2) If document is getting updated check if the parentshard field exists if
so update the doc to same shard.
But all these check conditions will increase response time , currently our
development is done in cloud mode with single shard and  using solrj to
save the data.
Also i an unable to figure out the query to update  doc to a particular
shard.

Any suggestions will help .

Thanks in Advance
sam

Reply via email to