Incorrect value_count on a string value

(Ramesh Bobba) #1


I have 6 simple documents:


I am running a value_count aggregation on this dataset using:

curl -XGET '' -d '{"size":0,"aggregations":{"SUMMARY_0_sid":{"value_count":{"field":"sid"}}}}'

I am expecting the results to be 6 but I am getting 14!

this seems to be an obvious error but what am I missing here?


(Christoph) #2

If you didn't define any mapping, the "sid" field will be mapped to an analyzed string field by default (see dynamic mapping for details). The default analyzer used is the Standard Analyzer which will split words containing the - character. So for your first two documents the "sid" fields will be indexed as five tokens, giving you 14 in total.

(system) #3