Ah, so there is currently not easy way of getting exact unique counts out of elasticsearch?
I found a manual way of doing it: curl -s 'http://localhost:9200/twitter-2014.03.26/_search' -d '{ "facets": { "a": { "terms": { "field": "screen_name", "size": 200000},"facet_filter": {"query": {"term": {"lang": "en"}}}}},"size": 0}' | ./jq '.facets.a.terms | length' 145474 (vs 145541) curl -s 'http://localhost:9200/twitter-2014.03.26/_search' -d '{ "facets": { "a": { "terms": { "field": "screen_name", "size": 200000},"facet_filter": {"query": {"term": {"lang": "ja"}}}}},"size": 0}' | ./jq '.facets.a.terms | length' 50949 (vs 50824) So the count is quite close! Thank you. On Friday, March 28, 2014 10:32:55 PM UTC+1, Binh Ly wrote: > > value_count is the total number of values extracted per bucket. This > example might help: > > https://gist.github.com/bly2k/9843335 > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8669e9f0-eece-4b77-8e99-fec483359e2f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.