【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
                ]
            }
        ]
    }
}

 

相关文章

TCP/IP套接字登录方法是MySQL在一切服务平台都提供的一种登录...
easy-rule规则引擎最佳落地
Elasticsearch 是一个分布式、高扩展、高实时的搜索与数据分...
最近壹哥的一个学生,在利用spring-data-elasticsearch访问E...
java 操作elasticsearch详细总结
原文链接:http://www.ruanyifeng.com/blog/2017/08/elastic...