elasticsearch - 是否可以使用 Elastic Search 消除 "empty"面?

标签 elasticsearch

我终于设法让 Elastic Search 索引按照我希望的方式工作,使用子字段和 not_analyzed 为某些字段的原始值建立索引。这些方面是我所期望的,但是,在某些情况下,由于这些字段的源数据具有空/空值,我在方面部分中得到如下结果:

  "things": {
     "_type": "terms",
     "missing": 187,
     "total": 12214,
     "other": 10608,
     "terms": [
        {
           "term": "foo",
           "count": 912
        },
        {
           "term": "",
           "count": 532
        },
        {
           "term": "bar",
           "count": 37
        }
     }
  }

注意第二项中的“”。我可以理解为什么 ElasticSearch 不会自动排除这一点,因为人们可能想知道有多少文档没有该字段。但出于我的目的,我不想将其退回。

是否可以通过某种方式将 ElasticSearch 配置为在索引或查询中忽略这些内容?

最佳答案

尝试放置

        "exclude" : ""

在你的聚合术语中

关于elasticsearch - 是否可以使用 Elastic Search 消除 "empty"面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23574599/

相关文章:

Elasticsearch 索引不工作和错误消息 : node null not part of the cluster Cluster [elasticsearch], 忽略

ssl - DBeaver SSL 已禁用

elasticsearch - Logstash和ElasticSearch之间的数据丢失

windows - 在 Windows 上安装 PacketBeat

ruby-on-rails - 获取以[。]开头或结尾的错误对象字段

具有多个 Elasticsearch 集群的 Spring Boot 启动速度非常慢

elasticsearch - 在 Kibana 中使用 Lucene 表达式除以 2 个整数字段

elasticsearch - ElasticSearch-筛选,分组并计算每个组的结果

php - SearchPhaseExecutionException [无法执行阶段[查询]

regex - 如何在Elasticsearch中写正则表达式查询,该查询匹配除斜杠以外的任何字符?