-
Notifications
You must be signed in to change notification settings - Fork 99
Add federated search parameters #1689
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
Changes from all commits
7e6e422
b5fff0d
0640015
85d574d
a8b823f
6b77b22
772761f
b218f1f
1c48c80
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,8 +5,6 @@ | |
* Copyright: 2019, MeiliSearch | ||
*/ | ||
|
||
'use strict'; | ||
|
||
import { Index } from '../indexes'; | ||
import { | ||
KeyCreation, | ||
|
@@ -34,6 +32,8 @@ import { | |
DeleteTasksQuery, | ||
MultiSearchParams, | ||
MultiSearchResponse, | ||
SearchResponse, | ||
FederatedMultiSearchParams, | ||
} from '../types'; | ||
import { HttpRequests } from '../http-requests'; | ||
import { TaskClient, Task } from '../task'; | ||
|
@@ -216,10 +216,18 @@ class Client { | |
* @param config - Additional request configuration options | ||
* @returns Promise containing the search responses | ||
*/ | ||
async multiSearch<T extends Record<string, any> = Record<string, any>>( | ||
queries?: MultiSearchParams, | ||
multiSearch<T extends Record<string, unknown> = Record<string, any>>( | ||
queries: MultiSearchParams, | ||
config?: Partial<Request>, | ||
): Promise<MultiSearchResponse<T>>; | ||
multiSearch<T extends Record<string, unknown> = Record<string, any>>( | ||
queries: FederatedMultiSearchParams, | ||
config?: Partial<Request>, | ||
): Promise<SearchResponse<T>>; | ||
async multiSearch<T extends Record<string, unknown> = Record<string, any>>( | ||
queries: MultiSearchParams | FederatedMultiSearchParams, | ||
config?: Partial<Request>, | ||
): Promise<MultiSearchResponse<T>> { | ||
): Promise<MultiSearchResponse<T> | SearchResponse<T>> { | ||
Comment on lines
+219
to
+230
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems really overkill to me (and hardly maintainable). I think we can just keep it as it was, and find a way to type There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you look into I have tried typing There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok thanks for the explanation 👍 |
||
const url = `multi-search`; | ||
|
||
return await this.httpRequest.post(url, queries, undefined, config); | ||
|
Uh oh!
There was an error while loading. Please reload this page.