ElasticSearch: query for N items of each category

前端 未结 1 1781
无人共我
无人共我 2021-01-28 03:10

I have an index of goods in ElasticSearch (5.5), of them every product has a field \"category\", like \"GLOVES\", \"COAT\", \"TOWEL\".

With the terms query

1条回答
  •  故里飘歌
    2021-01-28 03:38

    You may want to try top hits agg documented here.

    0 讨论(0)
提交回复
热议问题