How to group results in elasticsearch?

前端 未结 4 1297
慢半拍i
慢半拍i 2020-12-29 10:00

I am storing Book Titles in elasticsearch and they all belong to many shops. Like this:

{
    \"books\": [
        {
            \"id\": 1,
            \"tit         


        
4条回答
  •  醉梦人生
    2020-12-29 10:36

    I have the same problem but the best solution that I have found is change the mapping. You can convert the mapping to that the field "store" will be of type nested. This is because you have an relation many to many. In that way you can apply sorting, pagination. I hope to help.

提交回复
热议问题