# Extra returned field in facet

**URL:** <https://discuss.elastic.co/t/extra-returned-field-in-facet/9199>\
**Category:** Elasticsearch\
**Created:** [October 1, 2012, 9:52am UTC](https://discuss.elastic.co/t/extra-returned-field-in-facet/9199 "2012-10-01T09:52:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christoph\_Kempen](https://avatars.discourse-cdn.com/v4/letter/c/c68b51/32.png) [@Christoph\_Kempen](https://discuss.elastic.co/u/Christoph_Kempen)\
**Post date:** [October 1, 2012, 9:52am UTC](https://discuss.elastic.co/t/extra-returned-field-in-facet/9199/1 "2012-10-01T09:52:25Z")

</div>

Hi,

When using term-facets you get the term and count back per facet. Often the  
term returned is not suitable for use in URL's.

In my document I have a pretty-url version of all facets, but I have to do  
lookups for those when I use them in my application. It would be really  
efficient when calculating the facet to have to ability to return extra  
field(s) with data.  
would be like

{

```
"facet": {

    "_type": "terms",

    "missing": 0,

    "total": 570754,

    "other": 102799,

    "terms": [

        {

            "term": "Some Facet Text",

            "count": 10104

        },

        {

            "term": "Awesome ElasticSearch",

            "count": 7121

        }

    ]

}

```

}

would be something like

{

```
"facet": {

    "_type": "terms",

    "missing": 0,

    "total": 570754,

    "other": 102799,

    "terms": [

        {

            "term": "Some Facet Text",

            "count": 10104,

            "fields": [{ "url": "some-facet-text" }]

        },

        {

            "term": "Awesome ElasticSearch",

            "count": 7121,

            "fields": [{ "url": "awesome-elasticsearch" }]

        }

    ]

}

```

}

Is this already possible?

Christoph

--

---

<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 6, 2017, 3:10am UTC](https://discuss.elastic.co/t/extra-returned-field-in-facet/9199/2 "2017-07-06T03:10:38Z")

</div>

Closed on July 6, 2017, 3:10am UTC


