-
Notifications
You must be signed in to change notification settings - Fork 730
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
Using generics with SearchRequest #1805
Comments
This issue is stale because it has been open 90 days with no activity. Remove the |
This enhancement request for SearchRequest is still valid |
This issue is stale because it has been open 90 days with no activity. Remove the |
Reopening because this is still something we want to work on. I was on leave for 2 months so the stalebot got this one before I could keep it alive. |
This issue is stale because it has been open 90 days with no activity. Remove the |
This issue is stale because it has been open 90 days with no activity. Remove the |
How can I use generics with SearchRequest? I'd like to enforce compile-time check for my queries. Field type is string. Instead I'd prefer it to be
key of T
withSearchRequest<T>
. Please help!SearchApi definition from version 8.x of @elastic/elasticsearch npm package.
export default function SearchApi<TDocument = unknown, TAggregations = Record<T.AggregateName, T.AggregationsAggregate>>(this: That, params?: T.SearchRequest | TB.SearchRequest, options?: TransportRequestOptions): Promise<T.SearchResponse<TDocument, TAggregations>>;
The text was updated successfully, but these errors were encountered: