# Prefix aggregation

**URL:** <https://discuss.elastic.co/t/prefix-aggregation/34502>\
**Category:** Elasticsearch\
**Created:** [November 13, 2015, 11:00am UTC](https://discuss.elastic.co/t/prefix-aggregation/34502 "2015-11-13T11:00:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![razafinr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/razafinr/32/45334_2.png) [@razafinr](https://discuss.elastic.co/u/razafinr)\
**Post date:** [November 13, 2015, 11:00am UTC](https://discuss.elastic.co/t/prefix-aggregation/34502/1 "2015-11-13T11:00:03Z")

</div>

Hi,

This topic was already discussed in:

> <https://github.com/elastic/elasticsearch/issues/10408>

Although there was no solution/workaround in the discussion, I am asking the question again here.

Is there a way to have prefix buckets for aggregation, for example (inspired from the github discussion), the results would be like:

```
{
     buckets: [
    {
       "key": "/blog",
       "doc_count": 1000
    } ,
    {
       "key": "/user",
       "doc_count": 100
    }
  ]
}

```

`/blog` and `/user` are the keys of prefix buckets.

I didn't find any way to do this with the filtered aggregation.

---

<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:** [July 5, 2017, 11:38pm UTC](https://discuss.elastic.co/t/prefix-aggregation/34502/2 "2017-07-05T23:38:39Z")

</div>


