You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a project where I'm converting from elasticsearch to opensearch, on a node/express server. (npm v @opensearch-project/opensearch@3.0.0-beta.3 )
I am noticing some (potential?) issues with the typings in this package, specifically the sort:
sortQuery:
my sortQuery func needs to return a SortCombinations compliant type object. In elasticsearch, the SortCombinations accomodates sorting by the field name with the SortOptions type like so:
es typings:
BUT, when we see the similar sort typings in os, it lacks the SortOptions of [property: string]: FieldSort | SortOrder | etc, etc. which allows the correct typings to be recognized for sorting by field names.
When using my own 'incorrectly' typed code it works perfectly fine to sort the opensearch results despite what the typings show , and in the opensearch docs it shows the functionality as one would expect:
Related component
Search
To Reproduce
Build an opensearch search query in ts/js.
and a sort object to the body
see typings mismatch
Expected behavior
typings should include field name sorting.
Additional Details
No response
The text was updated successfully, but these errors were encountered:
Thank you for bringing this to our attention. This incomplete typing for sort comes from the spec, which 3.x API is generated from. I've created an issue for it.
Describe the bug
I have a project where I'm converting from elasticsearch to opensearch, on a node/express server. (npm v @opensearch-project/opensearch@3.0.0-beta.3 )
I am noticing some (potential?) issues with the typings in this package, specifically the sort:
sortQuery:
my sortQuery func needs to return a SortCombinations compliant type object. In elasticsearch, the SortCombinations accomodates sorting by the field name with the SortOptions type like so:
es typings:
BUT, when we see the similar sort typings in os, it lacks the SortOptions of [property: string]: FieldSort | SortOrder | etc, etc. which allows the correct typings to be recognized for sorting by field names.
When using my own 'incorrectly' typed code it works perfectly fine to sort the opensearch results despite what the typings show , and in the opensearch docs it shows the functionality as one would expect:
Related component
Search
To Reproduce
Expected behavior
typings should include field name sorting.
Additional Details
No response
The text was updated successfully, but these errors were encountered: