Facet on multiple properties


(eunever32) #1

Hey,.

Say I have a list of properties below,
what is the facet query that will give me the totals of where each field
occurs.
In the example below, I want to see f1: 4 etc

index/type/1
{
"my_doc": {
"list": [
{
"f1": "aaa",
"f2": "bbb",
"f3": "ccc",
"f5": "ddd",
"f4": "eee",
"f6": " "
},
{
"f1": "aaa",
"f3": "bbb",
"f4": "ccc",
"f2": "ddd",
"f5": "eee",
"f6": " "
}]

}
index/type/2
{
"my_doc": {
"list": [
{
"f1": "aaa",
"f3": "bbb",
"f4": "ccc",
"f2": "ddd",
"f5": "eee",
"f6": " "
},
{
"f1": "aaa",
"f3": "bbb",
"f4": "ccc",
"f2": "ddd",
"f5": "eee",
"f6": " "
}
}

I want to get counts of each field f1, f2, f3, f4, f5, f6
Totals:
f1: 4
f2: 4
f3: 4
f4: 4
f5: 4
f6: 4

--
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/cbc9a88e-c61b-46e1-93d1-5bcd1acdd423%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(system) #2