SolrCloud Wiki翻譯(4)Distributed Requests

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
本文完
相關文章
相關標籤/搜索