Find distinct values, not distinct counts in elasticsearch

前端 未结 4 1086
陌清茗
陌清茗 2020-11-30 06:38

Elasticsearch documentation suggests* that their piece of code

*documentation fixed

GET /cars/transactions/_search?search_type=         


        
4条回答
  •  情歌与酒
    2020-11-30 07:16

    Personally, both of the answers were arcane to me and hopelessly complex when I wanted to add multiple filters.

    For me, what made sense was to go on the Discover tab and apply the filters I wanted. I then saved my search.

    Then, I created a new Bar Chart visualization using my saved search. I then modified the X-Axis to use Terms aggregation based on my field of interest (in my case, Usernames), and then order by Count. Make sure the Size is something large, like 500.

    You should be able to get the results in tabular form underneath your chart. Simple, and no complex JSON programming. Just a series of clicks. You can even save the visualization for later.

提交回复
热议问题