美文网首页
elasticsearch http postman 查询数据

elasticsearch http postman 查询数据

作者: 淼哥1986 | 来源:发表于2020-04-16 11:06 被阅读0次
    • 查询数据,默认显示10条
    {
        "query": {
            "match_all": {}
        }
    }
    
    • 查询数据,可指定size,显示N条
    {
        "query": {
            "match_all": {}
        },
        "size": 2
    }
    
    • 关键字检索
    {
        "query": {
            "match": {
                "account_number": 20
            }
        }
    }
    
    • 关键字检索,&并且关系
    {
        "query": {
            "bool": {
                "must": [{
                        "match": {
                            "age": 38
                        }
                    },
                    {
                        "match": {
                            "address": "lane"
                        }
                    }
                ]
            }
        }
    }
    
    • 关键字检索,or或关系
    {
        "query": {
            "bool": {
                "should": [{
                        "match": {
                            "address": "mill"
                        }
                    },
                    {
                        "match": {
                            "address": "lane"
                        }
                    }
                ]
            }
        }
    }
    
    • 模糊检索,模糊匹配
    {
        "query": { 
            "wildcard": { 
                "firstname": "ha*" 
            } 
        } 
    }
    
    • 分词器,空格匹配
    {
        "query": {
            "match": {
                "address": "282 Place"
            }
        }
    }
    

    相关文章

      网友评论

          本文标题:elasticsearch http postman 查询数据

          本文链接:https://www.haomeiwen.com/subject/zaalvhtx.html