Elasticsearch匹配除指定字段之外的所有查询,排除 [英] Elasticsearch match all except specified fields query, exclude

查看:72
本文介绍了Elasticsearch匹配除指定字段之外的所有查询,排除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我索引化的Elasticsearch文档包含许多字段.我一直在使用 match_all 查询以获取结果.我想从match_all中排除一些字段,这可能吗?

My indexed Elasticsearch documents include many fields. I've been using match_all query to get results. There are a few fields I'd like to exclude from match_all, is this possible?

推荐答案

在Elasticsearch中,您可以使用

In Elasticsearch you can use partial fields to filter fields.

示例:

{
    "query": {
        "match_all": {}
    },
    "partial_fields": {
        "partial1": {
            "exclude": ["excludeField1", "excludeField2"]
        }
    }
}

这篇关于Elasticsearch匹配除指定字段之外的所有查询,排除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆