One of the advantages of using SolrCloud is the ability to distribute requests among various shards that may or may not contain the data that you're looking for. You have the option of searching over all of your data or just parts of it. html
使用SolrCloud的一个优点是,SolrCloud可以把你的请求分发到多个shard上面,固然每一个shard上面有可能包含也有可能不包含你须要查询的数据。你能够选择在所有数据上进行搜索或者是在一部分数据上搜索。 服务器
Querying all shards for a collection should look familiar; it's as though SolrCloud didn't even come into play: 负载均衡
查询一个collection全部shard的url看起来至关眼熟;好像SolrCloud根本没有参与到搜索过程当中来同样: url
http://localhost:8983/solr/collection1/select?q=*:* |
If, on the other hand, you wanted to search just one shard, you can specify that shard, as in: spa
另外一方面,若是你只是想要在单独一个shard里面搜索的话,你能够指定一个shard来进行搜索,以下所示: code
http://localhost:8983/solr/collection1/select?q=*:*&shards=localhost:7574/solr |
If you want to search a group of shards, you can specify them together: orm
若是你想要在一系列的shard上面进行搜索的话,你能够把他们声明在一块儿: server
http://localhost:8983/solr/collection1/select?q=*:*&shards=localhost:7574/solr,localhost:8983/solr |
Or you can specify a list of servers to choose from for load balancing purposes by using the pipe symbol (|): htm
或者说你能够经过使用(|)符号来声明一个服务器的的列表供Solr选择达到负载均衡的目的: ip
http://localhost:8983/solr/collection1/select?q=*:*&shards=localhost:7574/solr|localhost:7500/solr |
(If you have explicitly created your shards using ZooKeeper and have shard IDs, you can use those IDs rather than server addresses.)
(若是你明确的经过ZooKeeper用一系列的shard id建立了shard的话,你可使用这些id来代替,而不是使用服务器地址)
You also have the option of searching multiple collections. For example:
你也能够选择在多个collection上进行搜索,例如:
http://localhost:8983/solr/collection1/select?collection=collection1,collection2,collection3 |