# Kibana -

**URL:** <https://discuss.elastic.co/t/kibana/172143>\
**Category:** Kibana\
**Created:** [March 13, 2019, 12:16pm UTC](https://discuss.elastic.co/t/kibana/172143 "2019-03-13T12:16:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mariner191](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@Mariner191](https://discuss.elastic.co/u/Mariner191)\
**Post date:** [March 13, 2019, 12:16pm UTC](https://discuss.elastic.co/t/kibana/172143/1 "2019-03-13T12:16:55Z")

</div>

empty this post

---

<div class="post-metadata">

**Author:** ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)\
**Post date:** [March 14, 2019, 9:11pm UTC](https://discuss.elastic.co/t/kibana/172143/2 "2019-03-14T21:11:34Z")

</div>

Without knowing your index mappings, I can't provide an exact JSON query, but you probably want to do a [Terms Aggregation](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html) which will group the results into buckets, one for each unique value of the field.

Here's an example seach that may be close to what you need:

```nohighlight
GET /_search
{
    "aggs" : {
        "customerId" : {
            "terms" : {
                "field" : "customerId",
                "order" : { "max_score" : "desc" }
            },
            "aggs" : {
                "max_score" : { "max" : { "field" : "score" } }
            }
        }
    }
}

```

---

<div class="post-metadata">

**Author:** ![Mariner191](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@Mariner191](https://discuss.elastic.co/u/Mariner191)\
**Post date:** [March 15, 2019, 12:36pm UTC](https://discuss.elastic.co/t/kibana/172143/3 "2019-03-15T12:36:55Z")

</div>

empty this post

---

<div class="post-metadata">

**Author:** ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)\
**Post date:** [March 15, 2019, 3:17pm UTC](https://discuss.elastic.co/t/kibana/172143/4 "2019-03-15T15:17:47Z")

</div>

I think that request is showing up empty because no index matches the `_pindrop*` pattern. Can you provide the mappings of this request: `GET /pindrop*/_mapping`? (without the underscore before pindrop)

---

<div class="post-metadata">

**Author:** ![Mariner191](https://avatars.discourse-cdn.com/v4/letter/m/96bed5/32.png) [@Mariner191](https://discuss.elastic.co/u/Mariner191)\
**Post date:** [March 15, 2019, 3:34pm UTC](https://discuss.elastic.co/t/kibana/172143/5 "2019-03-15T15:34:12Z")

</div>

empty this post

---

<div class="post-metadata">

**Author:** ![joshdover](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/joshdover/32/42020_2.png) [@joshdover](https://discuss.elastic.co/u/joshdover)\
**Post date:** [March 15, 2019, 5:20pm UTC](https://discuss.elastic.co/t/kibana/172143/6 "2019-03-15T17:20:28Z")

</div>

Looks like your attachment didn't make it. Can you post it directly in the reply on the forum?

---

<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:** [April 12, 2019, 5:20pm UTC](https://discuss.elastic.co/t/kibana/172143/7 "2019-04-12T17:20:31Z")

</div>

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