Closed
Description
My team is using the withSort(Function<SortOptions.Builder, ObjectBuilder<SortOptions>> fn)
method in NativeQueryBuilder
to include sort criteria for an unbounded query. This sets the sortOptions
field when the query is built.
When the query is executed, the current implementation of doFindUnbounded
in ReactiveElasticsearchTemplate
calls addSort
on the built query with Sort.by("_shard_doc")
as the argument. This results in both sort
and sortOptions
being set, with sort
having precedence when the query object is converted to JSON, breaking the expected result order.
We're on 5.1.4