首页   快速返回

elasticsearch5.0搜索偏好
文章分类 elasticsearch
发布时间 2019-01-28 修改时间 2019-01-28
根据原文翻译整理
https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-request-preference.html



Controls a preference of which shard replicas to execute the search request on. 
By default, the operation is randomized between the shard replicas.

控制在哪个分片上执行搜索
默认会随机选择一个分片

_primary
The operation will go and be executed only on the primary shards.
只在主分片上执行

_primary_first
The operation will go and be executed on the primary shard, 
and if not available (failover), will execute on other shards.
先在主分片执行,如果不可用,在其他分片上执行

_replica
The operation will go and be executed only on a replica shard.

_replica_first
The operation will go and be executed only on a replica shard, and if not available (failover), will execute on other shards.

_local
The operation will prefer to be executed on a local allocated shard if possible.
尽量在本地分配的分片上执行

_prefer_nodes:abc,xyz
Prefers execution on the nodes with the provided node ids (abc or xyz in this case) if applicable.

_shards:2,3
Restricts the operation to the specified shards. (2 and 3 in this case). 
This preference can be combined with other preferences but it has to appear first: _shards:2,3|_primary

_only_nodes
Restricts the operation to nodes specified in node specification

Custom (string) value
A custom value will be used to guarantee that the same shards 
will be used for the same custom value. 
This can help with "jumping values" when hitting different shards in different refresh states. 
A sample value can be something like the web session id, or the user name.

上一篇     下一篇
java应用oom被kill排查记录

proc中进程内存信息

进程内存占用分析VSS/RSS/PSS/USS

elasticsearch5.0的一般建议

elasticsearch5.0索引性能优化

elasticsearch5.0搜索性能优化