Skip to content

Commit

Permalink
Cleanup search params
Browse files Browse the repository at this point in the history
  • Loading branch information
Liza K committed Jan 12, 2020
1 parent 1e1c470 commit ca9dea0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,10 @@ export function getMSearchParams(config: IUiSettingsClient) {
};
}

export function getSearchParams(config: IUiSettingsClient, esShardTimeout: number = 0) {
export function getSearchParams(config: IUiSettingsClient) {
return {
rest_total_hits_as_int: true,
ignore_unavailable: true,
ignore_throttled: getIgnoreThrottled(config),
max_concurrent_shard_requests: getMaxConcurrentShardRequests(config),
preference: getPreference(config),
timeout: getTimeout(esShardTimeout),
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,9 @@ function msearch({ searchRequests, es, config, esShardTimeout }: SearchStrategyS
};
}

function search({
searchRequests,
searchService,
config,
esShardTimeout,
}: SearchStrategySearchParams) {
function search({ searchRequests, searchService, config }: SearchStrategySearchParams) {
const abortController = new AbortController();
const searchParams = getSearchParams(config, esShardTimeout);
const searchParams = getSearchParams(config);
const promises = searchRequests.map(({ index, body }) => {
const params = {
index: index.title || index,
Expand Down

0 comments on commit ca9dea0

Please sign in to comment.