Filter by sub objects count

Hi guys. I have data in my index like this.
"locales" : {
"en_US" : {
"title_full" : "some text",
"title" : "some text"
},
"fr_FR" : {
"title_full" : "some text",
"title" : "some text"
}
},

How can i filter documents by count of sub objects in field like "where.locales.count() < 3".

Typically something to solve at index time.
You might use a painless script query but I feel it might be super slow.
Adding the size at index time will definitely help IMHO.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.