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.

使用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根本没有参与到搜索过程中来一样:

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:

另一方面,如果你只是想要在单独一个shard里面搜索的话,你可以指定一个shard来进行搜索,如下所示:

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:

如果你想要在一系列的shard上面进行搜索的话,你可以把他们声明在一起:

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 (|):

或者说你可以通过使用(|)符号来声明一个服务器的的列表供Solr选择达到负载均衡的目的:

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
本文完

转载于:https://my.oschina.net/zengjie/blog/199181

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值