-
Notifications
You must be signed in to change notification settings - Fork 126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] TS error when using _geo_distance
in sort
#963
Comments
This looks a bug in the API generator since the JSON Schema of GeoDistanceSort on the spec is: type: object
properties:
mode:
$ref: '#/components/schemas/SortMode'
distance_type:
$ref: '#/components/schemas/GeoDistanceType'
ignore_unmapped:
type: boolean
order:
$ref: '#/components/schemas/SortOrder'
unit:
$ref: '#/components/schemas/DistanceUnit' Note that Thanks for reporting this issue. I'll take a look at it and prepare a hotfix this week. |
This is actually a bug on the spec that has been resolved. Rerunning the API Code gen and preparing for the next minor version release with changes from the spec that will resolve this. |
3.2.0 has been released with the fix from the spec. |
@nhtruong Thanks! |
What is the bug?
TS doesn't allow the field with geo data to be added in the
_geo_distance
of thesort
object when performing a search.How can one reproduce the bug?
Re-using the example from the doc: https://opensearch.org/docs/latest/search-plugins/searching-data/sort/#sorting-by-geo-distance
TS will raise:
What is the expected behavior?
The
_geo_distance
should access thepoint
field (like it was before 3.0.0, but maybe because it wasn't properly typed)What is your host/environment?
MacOS, Node 22.
Do you have any additional context?
GeoDistanceSort
type doesn't allow any additional key:opensearch-js/api/_types/_common.d.ts
Lines 233 to 239 in dada26a
The text was updated successfully, but these errors were encountered: