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

elasticsearch(6) : CURL相关命令

elasticsearch(6) : CURL相关命令

参考 : elasticsearch中使用curl进行的简单查询_浅谈-CSDN博客_curl查询es某个索引数据

说明
  • 查询多个index可以前缀加*号,如 test_index*
查看所有索引
curl http://127.0.0.1:9200/_cat/indices?v
查看单个索引信息
curl -XGET http://127.0.0.1:9200/test_index?pretty
精确查询
curl -H "Content-Type:application/json" -XGET http://127.0.0.1:9200/test_index/_search?pretty -d  
'{
    "query": {
        "bool": {
            "must": [{
                "term": {
                    "timestamp": "1639140845491"
                }
            }]
        }
    }
}'
查询两条数据
curl -H "Content-Type:application/json" -XGET http://127.0.0.1:9200/test_index/_search?pretty -d 
'
{
    "query":{
        "match_all":{

        }
    },
    "size":2
}
'
范围查询
curl -H "Content-Type:application/json" -XGET http://127.0.0.1:9200/test_index/_search?pretty -d 
'
{
    "query":{
        "range":{
            "timestamp":{
                "gte": "1639140843491",
                "lte": "1639140846491"
            }
        }
    }
}
'
删除索引
curl -XDELETE http://127.0.0.1:9200/test_index

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

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

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