Skip to content

Commit

Permalink
[data.search] Send ccs_minimize_roundtrips=false for async search req…
Browse files Browse the repository at this point in the history
…uests
  • Loading branch information
lukasolson committed Jun 15, 2023
1 parent 6b65e90 commit 67ee74d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Expand Up @@ -111,6 +111,19 @@ describe('request utils', () => {
});
expect(params).toHaveProperty('keep_on_completion', false);
});

test('Sets `batched_reduce_size` and `ccs_minimize_roundtrips`', async () => {
const mockUiSettingsClient = getMockUiSettingsClient({
[UI_SETTINGS.SEARCH_INCLUDE_FROZEN]: false,
});
const batchedReduceSize = Math.floor(Math.random() * 64);
const mockConfig = getMockSearchConfig({
asyncSearch: { batchedReduceSize },
});
const params = await getDefaultAsyncSubmitParams(mockUiSettingsClient, mockConfig, {});
expect(params).toHaveProperty('batched_reduce_size', batchedReduceSize);
expect(params).toHaveProperty('ccs_minimize_roundtrips', false);
});
});

describe('getDefaultAsyncGetParams', () => {
Expand Down
Expand Up @@ -38,6 +38,7 @@ export async function getDefaultAsyncSubmitParams(
Pick<
AsyncSearchSubmitRequest,
| 'batched_reduce_size'
| 'ccs_minimize_roundtrips'
| 'keep_alive'
| 'wait_for_completion_timeout'
| 'ignore_throttled'
Expand All @@ -50,6 +51,8 @@ export async function getDefaultAsyncSubmitParams(
return {
// TODO: adjust for partial results
batched_reduce_size: searchConfig.asyncSearch.batchedReduceSize,
// Decreases delays due to network when using CCS
ccs_minimize_roundtrips: false,
...getCommonDefaultAsyncSubmitParams(searchConfig, options),
...(await getIgnoreThrottled(uiSettingsClient)),
...(await getDefaultSearchParams(uiSettingsClient)),
Expand Down

0 comments on commit 67ee74d

Please sign in to comment.