Aggregation module - value_count clarification/problem

Hi,

I am trying to get the unique number of values for a given field. From my
understanding of "value_counthttp://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-aggregations-metrics-valuecount-aggregation.html"
it counts the number of values that are extracted from the aggregated
documents. After the steps in es-agg-test-1.sh, and on querying for unique
values of field "k" the response that I get is

{
"took": 16,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 20,
"max_score": 1,
"hits": [] //deleted content of "hits" to shorten the paste
},
"aggregations": {
"k_count": {
"value": 22
}
}
}

How can I be getting "value" 22, shouldn't it be 20 as thats the number of
unique "k" values in documents.

Another example, on querying for unique values of field "t" I get the
following response

{
"took": 7,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 20,
"max_score": 1,
"hits": [] //deleted content of "hits" to shorten the paste
},
"aggregations": {
"k_count": {
"value": 20
}
}
}

Again, shouldn't the "value" be 1, as the only value of "t" is 23 in all
documents.

--
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/23a23530-a690-4c93-b67e-6e6fe44c6ee1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

The link to gist is
https://gist.github.com/shivprak/8611922#file-es-agg-test-1-sh

On Friday, January 24, 2014 8:56:43 PM UTC-8, watsin...@gmail.com wrote:

Hi,

I am trying to get the unique number of values for a given field. From my
understanding of "value_counthttp://www.elasticsearch.org/guide/en/elasticsearch/reference/master/search-aggregations-metrics-valuecount-aggregation.html"
it counts the number of values that are extracted from the aggregated
documents. After the steps in es-agg-test-1.sh, and on querying for
unique values of field "k" the response that I get is

{
"took": 16,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 20,
"max_score": 1,
"hits": //deleted content of "hits" to shorten the paste
},
"aggregations": {
"k_count": {
"value": 22
}
}
}

How can I be getting "value" 22, shouldn't it be 20 as thats the number of
unique "k" values in documents.

Another example, on querying for unique values of field "t" I get the
following response

{
"took": 7,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 20,
"max_score": 1,
"hits": //deleted content of "hits" to shorten the paste
},
"aggregations": {
"k_count": {
"value": 20
}
}
}

Again, shouldn't the "value" be 1, as the only value of "t" is 23 in all
documents.

--
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/3f822944-898b-444a-b748-6be2f72809b6%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.