Details
-
Improvement
-
Resolution: Fixed
-
Major
-
None
-
None
-
None
-
1
Description
Currently, in order to use the sort option with the search API, fields to sort by must be passed in with a List[str]. The provided classes (SortString(), SortScore(), SortID() and SortField()) that inherit the Sort() class will not encode the fields into proper JSON to pass in the search request. The Sort() class and subclasses should be corrected in order to align with the RFC.
Works:
result = cluster.search_query( |
"travel-sample-index", search.TermQuery("downtown"), SearchOptions(sort=["-_score", "description"])) |
Once updated, add another example to docs to show users how to use the provided Sort() subclasses with the sort option in the search API.