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
Implement the same type of TypeScript generics for search responses as can be seen in the elastic javascript client, where it's possible to define the results type of the response.
Motivation
At the moment, the type definition of the results part of a search response is defined as results: Array<{}>;. Comparing with the elasticsearch js client, which we sadly doesn't seem to be able to use since we use the enterprise app search. The way they have solved this looks like a better approach in my opinion.
🚀 Feature Proposal
Implement the same type of TypeScript generics for search responses as can be seen in the elastic javascript client, where it's possible to define the results type of the response.
Motivation
At the moment, the type definition of the results part of a search response is defined as
results: Array<{}>;
. Comparing with the elasticsearch js client, which we sadly doesn't seem to be able to use since we use the enterprise app search. The way they have solved this looks like a better approach in my opinion.They seem to be using the Elasticsearch specification repo for this, at least according to their docs.
For context, we are utilizing the node js client in our project.
Example
The above would return the same response type as is currently implemented, but also with the results array typed with the Document interface.
The text was updated successfully, but these errors were encountered: