# Faceted Navigation With Labels

**URL:** <https://discuss.elastic.co/t/faceted-navigation-with-labels/11560>\
**Category:** Elasticsearch\
**Created:** [April 12, 2013, 8:55am UTC](https://discuss.elastic.co/t/faceted-navigation-with-labels/11560 "2013-04-12T08:55:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ben\_Mullard](https://avatars.discourse-cdn.com/v4/letter/b/50afbb/32.png) [@Ben\_Mullard](https://discuss.elastic.co/u/Ben_Mullard)\
**Post date:** [April 12, 2013, 8:55am UTC](https://discuss.elastic.co/t/faceted-navigation-with-labels/11560/1 "2013-04-12T08:55:52Z")

</div>

Hi all,

I'm new to Elasticsearch and I'm trying to work out how I can implement my  
use case. I want to build a link for each facet, such as in this  
pseudo-code:

[{facet.label}  
({facet.count})](https://discuss.elastic.co/category/%7Bcategory.code%7D/%7Bfacet.term%7D/)

My faceted navigation is built using this query:

{  
"query": {  
"query\_string": {  
"query": "\*"  
}  
},  
"facets": {  
"style": {  
"terms": {  
"field": "style.code",  
"order": "term"  
}  
},  
"brewery": {  
"terms": {  
"field": "brewery.code",  
"order": "term"  
}  
}  
}  
}

This brings back the facets with "term" and "count", where "term" is the  
code used in the URL. But how should I get the label for the URL? Is  
there a way I can return it in the facet result or do I need to my code in  
"facet.term" to retrieve the label from my database?

Cheers, Ben

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:41am UTC](https://discuss.elastic.co/t/faceted-navigation-with-labels/11560/2 "2017-07-06T02:41:27Z")

</div>

Closed on July 6, 2017, 2:41am UTC


