# Using min\_score in a bucket selector pipeline aggregation

**URL:** <https://discuss.elastic.co/t/using-min-score-in-a-bucket-selector-pipeline-aggregation/104960>\
**Category:** Elasticsearch\
**Created:** [October 23, 2017, 7:54pm UTC](https://discuss.elastic.co/t/using-min-score-in-a-bucket-selector-pipeline-aggregation/104960 "2017-10-23T19:54:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![crickes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/crickes/32/18009_2.png) [@crickes](https://discuss.elastic.co/u/crickes)\
**Post date:** [October 23, 2017, 7:54pm UTC](https://discuss.elastic.co/t/using-min-score-in-a-bucket-selector-pipeline-aggregation/104960/1 "2017-10-23T19:54:08Z")

</div>

I have an aggregation which produces an output like this using a significant terms aggregation:

```
{
  "took": 88,
  "timed_out": false,
  "num_reduce_phases": 3,
  "_shards": {
    "total": 1430,
    "successful": 1430,
    "failed": 0
  },
  "hits": {
    "total": 1071145,
    "max_score": 0,
    "hits": []
  },
  "aggregations": {
    "cluster": {
      "doc_count_error_upper_bound": 0,
      "sum_other_doc_count": 0,
      "buckets": [
        {
          "key": "group_1",
          "doc_count": 223759,
          "significant_methstat": {
            "doc_count": 223759,
            "bg_count": 1054597843,
            "buckets": [
              {
                "key": "type-1",
                "doc_count": 51683,
                "score": 0.08758472205101155,
                "bg_count": 176615496
              }
            ]
          }
        },
        {
          "key": "group-2",
          "doc_count": 189927,
          "significant_methstat": {
            "doc_count": 189927,
            "bg_count": 1054597843,
            "buckets": [
              {
                "key": "type-2",
                "doc_count": 49170,
                "score": 0.14131842028473424,
                "bg_count": 176615496
              }
            ]
          }
        },
        {
          "key": "group-3",
          "doc_count": 104259,
          "significant_methstat": {
            "doc_count": 104259,
            "bg_count": 1054597843,
            "buckets": [
              {
                "key": "type-3",
                "doc_count": 41541,
                "score": 0.1317421370332497,
                "bg_count": 315782621
              }
            ]
          }
        }...

```

I would like to be able to use the bucket selector aggregation to effectively drop buckets where the score is less than 1. You can do something similar with doc\_count, but I can't figure out what syntax I should use to reference the score value of the bucket.

Is it even possible to reference the 'score' of the bucket in a significant terms aggregation?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 20, 2017, 7:54pm UTC](https://discuss.elastic.co/t/using-min-score-in-a-bucket-selector-pipeline-aggregation/104960/2 "2017-11-20T19:54:24Z")

</div>

Closed on November 20, 2017, 7:54pm UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
