ElasticsearchHSQueryImpl allocates too much memory for query results

Description

This code:

Allocates an array with as many elements as the total number of hits in the index. When using paging, the total number of hits could be one million and the number of results we want to fetch only 10 elements, for instance. So this is bad.

I checked what I say, by the way: hits.total contains the total number of hits, irrespective of the "size" parameter.

Environment

None

Assignee

Yoann Rodière

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Feedback Requested

None

Components

Fix versions

Priority

Major
Configure