微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

【Elasticsearch Postman版】完全匹配精准匹配

1.请求方式:GET

2.请求URL: 

http://127.0.0.1:9200/shopping/_search

3.请求参数:

match_phrase

{
    "query" : {
        "match_phrase" : {
            "category" : "红米"
        }
    },
    "from" : 0,
    "size" : 10,
    "_source" : ["title", "category", "price"],
    "sort" : {
        "price" : {
            "order" : "desc"
        }
    }

}

4.响应信息

{
    "took": 2,
    "timed_out": false,
    "_shards": {
        "total": 1,
        "successful": 1,
        "skipped": 0,
        "Failed": 0
    },
    "hits": {
        "total": {
            "value": 1,
            "relation": "eq"
        },
        "max_score": null,
        "hits": [
            {
                "_index": "shopping",
                "_type": "_doc",
                "_id": "1002",
                "_score": null,
                "_source": {
                    "price": 9999.0,
                    "title": "红米手机",
                    "category": "红米"
                },
                "sort": [
                    9999.0
                ]
            }
        ]
    }
}

 

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐