Potentially broken sorting in unbounded queries built with NativeQueryBuilder
#2745
Labels
type: bug
A general bug
Milestone
My team is using the
withSort(Function<SortOptions.Builder, ObjectBuilder<SortOptions>> fn)
method inNativeQueryBuilder
to include sort criteria for an unbounded query. This sets thesortOptions
field when the query is built.When the query is executed, the current implementation of
doFindUnbounded
inReactiveElasticsearchTemplate
callsaddSort
on the built query withSort.by("_shard_doc")
as the argument. This results in bothsort
andsortOptions
being set, withsort
having precedence when the query object is converted to JSON, breaking the expected result order.We're on
5.1.4
The text was updated successfully, but these errors were encountered: