栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 前沿技术 > 大数据 > 大数据系统

Es基本操作命令

Es基本操作命令

1.查看所有索引:curl ‘localhost:9200/_cat/indices?v’
2.查看test索引(后缀美化:?pretty):curl -XGET ‘localhost:9200/test/search?pretty’
3.查看test_下所有索引:curl -XGET 'localhost:9200/test
/_search?pretty’
4.模糊查询(含有student)索引名称:curl 'localhost:9200/cat/indices?v’ | grep ‘student’
5.匹配ip等于哪个字段 只显示那个字段 curl -XPOST 'localhost:9200/test
/_search?pretty’ -d’{“query”:{“match”:{“ip”:“2.2.2.2”}},"_source":[“ip”,“name”]}’
6. must 相当于and(与)should相当于or: curl -XPOST ‘localhost:9200/test/_search?pretty’ -d ‘{“query”:{“bool”:{“must”:[{“term”:{“name”: “123”}},{“term”:{“type”: “3”}}]}}}’
7.时间范围以及时间排序取几条: curl -XGET ‘localhost:9200/test/_search?pretty’ -d ‘{“query”:{“range”: {“start_time”:{“lte”:1632363010000,“gte”:1610467210000 }}},"source":[“id”,“name”,“score”,“type”,“start_time”],“sort”:[{“start_time”:{“order”:“asc”}}],“from”:1,“size”:4 }’
8.取两条数据:curl -XGET 'localhost:9200/test
*/_search?pretty’ -d ‘{“from”:1,“size”:2 }’

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/600840.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号