I observed that if my index contains say 6 entry(document) and if I run the query with "size" == 25000 , I am getting following error
> Result window is too large, from + size must be less than or equal to: [10000] but was [25000]. See the scroll api for a more efficient way to request large data sets. This limit can be set by changing the [index.max_result_window] index level setting
If I change size to 10k ("size" == 10000) in query , I am getting result.
Our application needs to keep querying while index has few document(say 6 document) to large doc (say 50k+).
How to change Size in query dynamically. ?
Is it good practice to first fire _search api without query and read the "totoal" from hits and then call another search with query with size set.
Please suggest.