Nested Aggregations

Hi,

I have two queries with identical nested aggregations using min_doc_count =
0
option. The only difference is in the queries, first query is a
match_all() and the other a filtered query. The filtered query's
aggregations miss bucket keys here and there! I was expecting an exact
number of aggregation buckets with expected different counts. In the
documentation http://is.gd/Mvueh1 there are notes about possible inaccuracy
of min_doc_count, what I miss to understand is why the match_all() query
doesn't have this problem.

Below is an example of my two responses:

This is the reponse for match_all() query:
"Sociodemographic_economic_characteristics-und" : {
"buckets" : [ {
"key" : "Age",
"doc_count" : 30
}, {
"key" : "Birth_place",
"doc_count" : 4
}, {
"key" : "Education",
"doc_count" : 5
}, {
"key" : "Ethnic_race_religion",
"doc_count" : 0
}, {
"key" : "Family_hh_struct",
"doc_count" : 22
}, {
"key" : "Income",
"doc_count" : 5
}, {
"key" : "Labour_retirement",
"doc_count" : 9
}, {
"key" : "Language",
"doc_count" : 2
}, {
"key" : "Marital_status",
"doc_count" : 31
}, {
"key" : "Other_sociodemogr_chars",
"doc_count" : 0
}, {
"key" : "Residence",
"doc_count" : 33
}, {
"key" : "Sex",
"doc_count" : 11
} ]
}

This is the response for the fitlered query:

"attributes-Mlstr_area__Sociodemographic_economic_characteristics-und" : {
"buckets" : [ {
"key" : "Age",
"doc_count" : 0
}, {
"key" : "Birth_place",
"doc_count" : 0
}, {
"key" : "Education",
"doc_count" : 0
}, {
"key" : "Ethnic_race_religion",
"doc_count" : 0
}, {
"key" : "Family_hh_struct",
"doc_count" : 0
}, {
"key" : "Income",
"doc_count" : 0
}, {
"key" : "Labour_retirement",
"doc_count" : 0
}, {
"key" : "Language",
"doc_count" : 2
}, {
"key" : "Marital_status",
"doc_count" : 0
}, {
"key" : "Residence",
"doc_count" : 0
}, {
"key" : "Sex",
"doc_count" : 0
} ]
}

The missing bucket is for key Other_sociodemogr_chars.

Any insight is greatly appreciated.

--
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/f5d1f871-1fe2-405f-9ea5-03725a0b6dbd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.