Faceted Navigation With Labels

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})

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.
For more options, visit https://groups.google.com/groups/opt_out.