1. Indices 查询

原文链接 : https://www.elastic.co/guide/en/elasticsearch/reference/5.0/query-dsl-indices-query.html

译文链接 : http://www.apache.wiki/pages/viewpage.action?pageId=4882908

贡献者 : 蓝色飞扬

<< Boosting Query Joining Queries >>


1.1. Indices Query

在5.0.0中已弃用。

用搜索 _index 字段来代替

Indices 查询是在搜索跨多个指标执行的情况下非常有用。 它允许指定索引名称的列表和内部查询,该内部查询仅对与该列表上的名称匹配的索引执行。 对于被搜索、但没有在名单上的条目相匹配其他指数,使用 no_match_query 代为执行。

GET /_search
{
    "query": {
        "indices" : {
            "indices" : ["index1", "index2"],
            "query" : { "term" : { "tag" : "wow" } },
            "no_match_query" : { "term" : { "tag" : "kow" } }
        }
    }
}

可以使用 index 字段,以提供一个单一的索引。 no_match_query 的取值是“string”,可以为 none (匹配任何文件),也可以为 all (匹配所有)。 默认为allquery 是强制性的,此外还有 indices (或 index )也是强制性。


<< Boosting Query Joining Queries >>

Copyright © Kilvn 2021. all right reserved,powered by Gitbook最后更新时间: 2021-06-08 20:22:42

results matching ""

    No results matching ""