首页  

elasticsearch5.0搜索API使用概述     所属分类 elasticsearch 浏览量 1542
根据原文翻译整理
https://www.elastic.co/guide/en/elasticsearch/reference/5.0/search-search.html



两种使用方式
query string 
request body
 

Multi-Index, Multi-Type
多索引 多类型

search on all documents across all types within the twitter index
GET /twitter/_search?q=user:kimchy
搜索twitter索引的所有类型

GET /twitter/tweet,user/_search?q=user:kimchy

search all tweets with a certain tag across several indices
GET /kimchy,elasticsearch/tweet/_search?q=tag:wow

search all tweets across all available indices using _all placeholder

GET /_all/tweet/_search?q=tag:wow


search across all indices and all types
GET /_search?q=tag:wow

By default elasticsearch rejects search requests that would query more than 1000 shards. 
The reason is that such large numbers of shards make the job of the 
coordinating node very CPU and memory intensive. 
It is usually a better idea to organize data in such a way that there are fewer larger shards. 
In case you would like to bypass this limit, which is discouraged, 
you can update the action.search.shard_count.limit cluster setting to a greater value.


默认情况下,拒绝查询超过1000个碎片的搜索请求。
大量的分片使得协调节点的CPU和内存非常密集
通常情况下,更好的方法是用更少的大分片来组织数据。

如果你想绕过这个限制,这是不鼓励的,
可以将 action.search.shard_count.limit 设置更大的值。

上一篇     下一篇
elasticsearch5.0刷新机制

linux之grep命令

elasticsearch5.0搜索API概述

elasticsearch5.0基于url的搜索接口

新东方年会《释放自我》歌词

elasticsearch5.0使用RequestBody搜索接口