【问题标题】:Nested attribute term Query嵌套属性词查询
【发布时间】:2018-06-03 18:46:10
【问题描述】:

我有一个类似下面的文件

{ "_index": "lines", "_type": "lineitems", "_id": "4002_11", "_score": 2.6288738, "_source": { "data": { "type": "Shirt" } } }

我想获得基于类型属性值的计数。对此有何建议?

我尝试了术语查询,但没有使用它。

【问题讨论】:

    标签: elasticsearch elastic-stack elasticsearch-5


    【解决方案1】:

    您应该使用术语聚合,这将返回为每个“类型”字段值聚合的文档数。

    https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-18
      • 2022-01-22
      • 2015-10-02
      • 1970-01-01
      • 1970-01-01
      • 2022-11-10
      相关资源
      最近更新 更多