Filtered query - limiting result per id

Hello to All :slight_smile:

Today while I move to the office, I'm thinking about filters, and a
question was created and I could not answer.

Can I limit the number of results per id?

For example, i have a filter by id with this values : ids: (1,2,3)

and this:

                "bool": {
                    "must": [
                        {
                            "term": {
                                "id": {
                                    "value": "1","2","3"
                                }
                            }
                        }
                    ]
                }
            }

and the size of query is 15... But I need 5 registrys per id

id 1 = [a,b,c,d,e]
id 2 = [f,g,h,i,j]
id 3 = [k,l,m,n,o]

It's possible today with elastic search? I can't use a different queries
because I need the facet result, the best solution I see now is execute
fou4 queries ( 1 to facet and 3 with the filters).

We have a better option?

Thanks!!!

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.