Open djivko opened 1 month ago
Thanks for the report @djivko! This is related to #755, and will require similar fixes:
main
we can directly make the breaking type change similar to #769 2.x
to be backwards-compatible we'd need to do something like #1105Is this something you'd be interested in possibly contributing yourself?
@Xtansia sure I can give it a shot. It might take a bit more time though as I will be doing it im my spare time. Thanks for all the pointers!
What is the bug?
Executing a search request that has sorting in it will produce SearchHits results where each Hit will have it's
sort
array field populated. However thesort
array is always deserialized as string array and if one wants to use this value to repeat the request withsearch_after
being set to the returned value of thesort
this could result in an error from the server if the field type is not actually string.How can one reproduce the bug?
Create an index which has the following mapping
Java field definition
Add a few documents that get indexed and then execute a search request followed by another search that utilizes
search_after
. For exampleWhen executing the above code the server will return something like
However during deserialization the client will deserialize the
sort
field toThus repeating the request with search after will produce an error. Something like
What is the expected behavior?
The returned value types of the
sort
field must be maintained as returned from the server.What is your host/environment?
SpringBoot application
Do you have any additional context?
sort
member - check heresort
member fromList<String>
toList<FieldValue>
. Check this commit