user1224582
user1224582

Reputation: 41

Solr distributed search on different shards + on different machines

I am trying to implement distributed Solr search (need to use Solr 3.4 only) where the index is distributed on multiple machines. By shard here, I mean a shard folder containing the index, that the solr core has been configured to search on. It is configured in a parameters map and is not present in the solrconfig.xml file. So each machine will have different names of the shard folder.

For example:

host1:port1 -> shard=shard1,

host2:port2 -> shard=shard2,

host3:port3 -> shard=shard3.

The shard names on each machine are subject to change dynamically. So it cannot be configured in any xml. Using the "shards" param in the query: host:port/baseURL doesnt help me specify the shard name for that specific machine.

Is there a way to configure this shard name:host name mapping in the query? If not, could someone please let me know what would be the best approach to solve this?

Upvotes: 0

Views: 2101

Answers (1)

Jayendra
Jayendra

Reputation: 52789

If i understood your issue correctly, I think You should be able to specify the shard names in the query itself.

Like -

http://host1:port1/solr/shard1/select?shards=host2:port2/solr/shard2,host3:port3/solr/shard3&q=ipod+solr

e.g. http://localhost:8983/solr/shard1/select?shards=localhost:8984/solr/shard2,localhost:8985/solr/shard3&q=ipod+solr

Upvotes: 2

Related Questions