We have a few millions of documents, each can have zero to hundred of nested objects (thankfully its just one level of nesting, the rest are just text fields).
When issuing a boolean should match query with one nested query for the nested objects, it took 3sec to return 30 results paginated from more than 10k results.
However, as we add more and more nested query, e.g.
"bool": {
"should": [{
"dis_max": {
"queries": [{
"nested": {...},
"nested": {...},
"nested": {...},
the time needed to return results is getting slower and slower to a point it takes over a minute to return for a query with 25 nested queries.
Here are some stats:
No nested query 1sec
1 nested query 3sec
5 nested queries 8sec
11 nested queries 15sec
19 nested queries 40sec
25 nested queries over a minute
Is more than 10 nested queries already considered too much for Elasticsearch?
What other things can we try to reduce the query time?
Is it too unrealistic to try to reduce the time for say 20 nested queries to return within 5sec?
Thank you