Skip to content
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

Open
twisha opened this issue Jan 10, 2023 · 4 comments
Open

Using generics with SearchRequest #1805

twisha opened this issue Jan 10, 2023 · 4 comments

Comments

@twisha
Copy link

twisha commented Jan 10, 2023

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 with SearchRequest<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>>;

Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove the stale label, or leave a comment, or this will be closed in 14 days.

@github-actions github-actions bot added the stale label Nov 13, 2023
@twisha
Copy link
Author

twisha commented Nov 13, 2023

This enhancement request for SearchRequest is still valid

@stale stale bot removed the stale label Nov 13, 2023
Copy link
Contributor

This issue is stale because it has been open 90 days with no activity. Remove the stale label, or leave a comment, or this will be closed in 14 days.

@github-actions github-actions bot added the stale label Feb 12, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Feb 26, 2024
@JoshMock
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants