Have any way to get how many different value in one field?


(Ngọc Phạm) #1

sorry, im newbie and i have one question.

Im wondering about one issue, it is : have any way to know how many different value in one field in elasticsearch?

Example : name index is :twitter , type tweet , field user . And in field user have some value about
id user
1 Mr.A
2 Mr.B
3 Mr.C
4 Mr.A

Have any way elasticsearch know how many different user in this ? , in my example is 3 : Mr.A,Mr.B,Mr.C
i think maybe can use filter script but i dont know how to do .

Thanks for your help :sunny:


(system) #2