Suppose you had documents that fall into distinct categories: A, B, C, D, E, and F. Is it possible to make a query, such that the results are sorted in such a way that they are mixed/alternated evenly across these categories. For example, suppose your query had a boolean filter selecting a subset of the categories:
{
"size" : 10,
"query" {
"bool" : {
"must" : [
{ "term" : {"title" : "foo"}}
]
"should" : [
{ "term" : {"category" : "A"}},
{ "term" : {"category" : "B"}},
{ "term" : {"category" : "C"}}
]
}
}
}
Is it possible to generate results that look like:
A,A,B,B,C,C,A,A,B,B