es 相干命令
1. 查看索引,集群命令
1.查看集群状态```curl -XGET 'localhost:9200/_cluster/_health?pretty'```2.查看集群衰弱状态```curl -XGET 'localhost:9200/_cat/nodes?v'```
2. 查问语法
1.范畴查问"query":{ "range":{ "gt":1, "lt":100 }}2. 聚合查问"aggs":{ "all_intersts":{ "terms":{"field":"interstece.keyword"}, "aggs":{"avg_price":{"avg":{"field":"price}}} }}3. 查问表字段映射curl 'localhost:9200/db/_mapping?pretty'4. 空查问"query":{ "match_all":{}}5. match查问会分词"query":{ "match":{ "age":"18" }}6. terms 查问 查找tag是a或者b的"query":{ "terms":{"tag":["a","b"]}}7. term查问"query":{ "term":{"first_name":"zhangsan"}}//如果是text类型的话要加keyword,不然查不进去数据"query":{ "term":{"first_name.keyword":"zhangsan"}}8. exists 查问"query":{ "exists":{"field":"first_name"}}
查问和过滤
- 查问有相关性 不会缓存
- 过滤返回的后果是true|false 会缓存
2. 更新语法
3.es默认只会查出10条数据