Named Queries

每个过滤器和查询可以在其顶级定义中接受一个_name

GET /_search
{
    "query": {
        "bool" : {
            "should" : [
                {"match" : { "name.first" : {"query" : "shay", "_name" : "first"} }},
                {"match" : { "name.last" : {"query" : "banon", "_name" : "last"} }}
            ],
            "filter" : {
                "terms" : {
                    "name.last" : ["banon", "kimchy"],
                    "_name" : "test"
                }
            }
        }
    }
}

搜索响应将为每个匹配项添加其匹配的matched_queries。 查询和过滤器的标记仅对bool查询有意义。

© ApacheCN Team all right reserved,powered by Gitbook该文件修订于: 2018-03-13 09:41:17

results matching ""

    No results matching ""