elastic / search-ui

Search UI. Libraries for the fast development of modern, engaging search experiences.
https://docs.elastic.co/search-ui
Apache License 2.0
1.91k stars 368 forks source link

Incorrect typescript interface for SortOption on react-search-ui #1070

Open eliezra236 opened 2 months ago

eliezra236 commented 2 months ago

There seems to be incorrect interface for SortOption on react-search-ui

Screenshots This config works - while showing typescript error

sort: [
 {'_score': 'desc'}
]

image

This config doesn't work - while type is "correct".

sort: [
  { field: '_score', direction: 'desc' },
]

It render the following error instead of the UI An unexpected error occurred: [400] Sort contains an object with more than one key: field and direction

Which backends and packages are you using: Backend: App Search 8.15 Packages: react-search-ui@1.21.5

botelastic[bot] commented 6 days ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Is this issue still important to you? If so, please leave a comment and let us know. As always, thank you for your contributions.