Skip to content

Fix value of request size sent to Elasticsearch when no Pageable is defined in a query #3127

Open
@sothawo

Description

@sothawo

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions