Top match in category

Say I have an online bookstore. If someone searches for "dinosaur", I want to return the top 3 matches in fiction, non-fiction, and reference categories. Is this possible with a single query in ES, or would I need to issue a separate query for each category?

You could run an _msearch, with one search per category in that request, with a size of 3.

1 Like

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