I just tried out new aggregation framework and wanted to see if new
aggregation could resolve my previously discussed and unresolved problem:
https://groups.google.com/forum/?fromgroups#!topic/elasticsearch/-oiL2hvjieY
Since aggregation framework is planned as replacement for facets, i am
wondering how can i filter term aggregations, without loosing actual terms,
because as soon as i add "filter", then aggregations return only count.
So i am looking something like "facet_filter" for facets.
Or this is feature is not yet developed?
Here is the mapping and sample data:
Here is query i tried:
{
"query": {
"match": {
"credits.person_id": 1
}
},
"aggs": {
"departments": {
"terms": {
"field": "credits.department"
}
}
},
"size": 0
}
Results:
"aggregations": {
"departments": {
"buckets": [
{
"key": "producer",
"doc_count": 2
},
{
"key": "director",
"doc_count": 2
},
{
"key": "actor",
"doc_count": 2
}
]
}
}
When i tried adding filter i got following result, without ability to see
term value:
Query:
{
"query": {
"match": {
"credits.person_id": 1
}
},
"aggs": {
"departments": {
"terms": {
"field": "credits.department"
},
"filter": {
"term": {
"genre": "comedy"
}
}
}
},
"size": 0
}
Result:
"aggregations": {
"departments": {
"doc_count": 1
}
}
--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/f9c0b90f-8d79-4e3f-bbbf-58df4c083294%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.