mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
Previous to this change any request using a script sort in a top_hits aggregation would fail because the compilation of the script happened after the QueryShardContext was frozen (after we had worked out if the request is cachable). This change moves the calling of build() on the SortBuilder to the TopHitsAggregationBuilder which means that the script in the script_sort will be compiled before we decide whether to cache the request and freeze the context. Closes #21022