Description
When implementing the fix for #3089 in #3106 we introduced a regression. By adding the logic that the Pageable
in a query defines the number of documents to retrieve from Elasticsearch in one call and the maxResults
is used for the total number of documents fetched in a searchForStream
called.
As a query that has no Pageable
set has a default one with a page size of 10, this now leads to only 10 documents being returned on searches that do not use searchForStream
. Users now need to explicitly need to set a Pageable
.
One solution would be to not set a default Pageable
in a Query
, instead of the current default with size 10. Users that want to page in steps of ten anyway need to define a pageable in their query and adjust it for subsequent calls (setting the offset). Users not setting a pageable then would get the min(INDEX_MAX_RESULT_WINDOW, maxResults)
number of documents. INDEX_MAX_RESULT_WINDOW
has the value of 10000 and is the maximum that Elasticsearch normally might return. This should restore the previous behaviour for users not setting a Pageable
but a maxResults
value.