0

I have 6 simple documents:

{"id":1,"sid":"adf6eb4f-35a0-4099-95d4-00ce3d984cf2","asid":"577ce6b0-b8b7-49af-8528-4e4797027a12","_tid":"21"}
{"id":1,"sid":"adf6eb4f-35a0-4099-95d4-00ce3d984cf2","asid":"577ce6b0-b8b7-49af-8528-4e4797027a12","_tid":"21"}
{"id":2,"sid":"abcdef","asid":"fedcba","_tid":"21"}
{"id":3,"sid":"ghijk","asid":"kjihg","_tid":"21"}
{"id":4,"sid":"lmnop","asid":"ponml","_tid":"21"}
{"id":5,"sid":"prstuv","asid":"vutsrp","_tid":"21"}

I am running a value_count aggregation on this dataset using:

curl -XGET 'http://poc02.transerainc.com:9200/test/csrs/_search' -d '{"size":0,"aggregations":{"SUMMARY_0_sid":{"value_count":{"field":"sid"}}}}'

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

{"took":3,"timed_out":false,"shards":{"total":5,"successful":5,"failed":0},"hits":{"total":6,"maxscore":0.0,"hits":[]},"aggregations":{"SUMMARY_0_sid":{"value":14}}}

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

1 Answer 1

2

you should check your elasticsearch mapping setting for sid, is sid an analyzed field (it most likely is by default)? if it is being treated as an analyzed field then "adf6eb4f-35a0-4099-95d4-00ce3d984cf2" would be broken up into 5 different pieces. so total count accumulates to 5+5+1+1+1+1=14

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.