ES-endpoint
生活随笔
收集整理的這篇文章主要介紹了
ES-endpoint
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
1 常用endpoint
| 方式 | endpoint | 描述 |
| PUT? | [index] | 新建索引? 請求體可參考:2.1 新建索引請求體樣式? |
| _template/[template] | 添加模板? 請求體可參考:2.2? 新建模板請求體樣式? | |
| [index]/[type]/[id] | 添加數(shù)據(jù),無[id]時,隨機生成20位的id? 請求體可參考:2.3 添加數(shù)據(jù)請求體樣式 | |
| [index]/_settings | 修改索引設(shè)置信息? 請求體可參考:2.7? | |
| POST | [index]/[type]/[id] | 添加數(shù)據(jù),無[id]時,隨機生成20位的id? 請求體可參考:2.3 添加數(shù)據(jù)請求體樣式 |
| _reindex | 數(shù)據(jù)遷移?請求體可參考: 2.4 數(shù)據(jù)遷移請求體樣式 | |
| [index]/_delete_by_query | 基于查詢的刪除? 請求體內(nèi)容:? DSL query查詢語句 | |
| [index]/[type]/[id]/_update | 更新數(shù)據(jù)?請求體可參考: 2.5 更新請求體樣式 | |
| GET | [index]/[type]/_search | 查詢索引中數(shù)據(jù),?[index],[type]可選,控制范圍. 請求體內(nèi)容?: DSL query查詢語句?? |
| lib*/_search | 查詢所有相同前綴索引數(shù)據(jù) | |
| _cat/indices | 查詢所有索引及容量 | |
| [index]/_mapping | 查詢索引映射結(jié)構(gòu),無[index]時,查所有映射信息 | |
| _all | 查詢所有索引映射結(jié)構(gòu) | |
| _template | 查詢所有模板 | |
| _template/[template] | 查詢指定模板 | |
| _cluster/health | 查詢集群健康狀態(tài) | |
| _cat/nodes | 查詢所有節(jié)點 | |
| _cat/shards | 查詢索引及分片的分布 | |
| _cat/plugins | 查詢所有插件 | |
| [index]/[type]/_count | 查看文檔數(shù)量?[index],[type]可選,控制范圍 | |
| [index]/[type]/[id]/_source | 不查詢文檔的元數(shù)據(jù),只查詢source部分的數(shù)據(jù) | |
| [index]/[type]/_mget | 取回多個文檔,[index]/[type]可選,控制范圍,請求體內(nèi)容? 2.6?mget請求體樣式? | |
| [index]/_settings | 查看索引設(shè)置信息,[index] 可選,控制范圍 | |
| ? | ? | |
| DELETE | [index] | 刪除索引 |
| [index]/[type]/[id] | 通過id刪除數(shù)據(jù) | |
| _template/[template] | 刪除模板 | |
| ? | ? | |
| ? | ? | |
| ? | ? |
?
2. 備注
2.1 新建索引請求體樣式
{"mappings": {"doc": {"properties": {"name": {"type": "text"},"blob": {"type": "binary"}}}} }2.2? 新建模板請求體樣式
{"template" : "my-*","order" : 0,"settings" : {"number_of_shards" : 10,"number_of_replicas" : 0},"mappings": {"default": {"_all": {"enabled": false},"properties": {"name": {"type": "text"},"age": {"type": "long"}}}} }2.3 添加數(shù)據(jù)請求體樣式
2.4 數(shù)據(jù)遷移請求體樣式
{"source": {"index": "my_index"},"dest": {"index": "new_my_index"} }2.5 更新請求體樣式
{"doc":{"name":"kyle","age":20} }2.6?mget請求體樣式
//可在endpoint中指定index type,也可在請求體中指定 {"docs" : [{"_index" : "demo2","_type" : "system","_id" : 2,"_source":["name"]}] } //只指定index,可根據(jù)is查詢 {"ids":[1,2] }2.7 設(shè)置請求體樣式
{ "index" : {"number_of_replicas":0} }?
總結(jié)
以上是生活随笔為你收集整理的ES-endpoint的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 谷歌android中文版,google
- 下一篇: FFmpeg 音视频倍速控制