We have a query which returns a large number of results, sorted alphabetically and we're using a pagination to iterate through these pages.
I wonder: can we use aggregations to get the page, containing the element with the largest score?
Just for example, we have 10 results of query (match: "Foo") in 4 pages, sorted alphabetically:
- A Foo | (score 1)
- B Foo | (score 1)
- C Foo | (score 1)
- D Foo | (score 1)
- E Foo | (score 1)
- Foo | (score 2)
- G Foo | (score 1)
- H Foo | (score 1)
- I Foo | (score 1)
- Foo | (score 1)
How can we get something like that?
top result:
| Foo
top page:
| Number: 2
| Content:
| 4. D Foo | (score 1)
| 5. E Foo | (score 1)
| 6. Foo