I have articles data indexed to elastic as follows.
{
"id": 1011,
"title": "abcd",
"author": "author1"
"status": "published"
}
Now I wanted to get all the article id
grouped by status
.
Result should someway look like this
{
"published": [1011, 1012, ....],
"draft": [2011],
"deleted": [3011]
}
NB: I tried normal aggs ( Article.search('*',aggs: [:status], load: false).aggs
) , it just giving me the count of each items in, I want ids in each item instead
@Crazy Cat You can transform you query in this way:
Now the advantages of this technique:
Now the Disadvantages:
I Hope this redesign of your query might be helpful to you.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.