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

[data.search] Remove deprecated courier:batchSearches advanced setting #109350

Merged
merged 27 commits into from
Aug 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4000b13
[data.search] Handle warnings inside of headers
lukasolson Jun 29, 2021
1effec0
Merge branch 'master' into search-handle-warnings
lukasolson Jun 30, 2021
1436872
Update docs
lukasolson Jul 1, 2021
158d491
Merge branch 'master' into search-handle-warnings
lukasolson Jul 1, 2021
85b4486
Merge branch 'master' into search-handle-warnings
lukasolson Jul 6, 2021
a98e7c6
Add tests
lukasolson Jul 7, 2021
69e1bc9
Merge branch 'master' into search-handle-warnings
kibanamachine Jul 8, 2021
68f4361
Merge branch 'master' into search-handle-warnings
kibanamachine Jul 13, 2021
9883f46
Merge branch 'master' into search-handle-warnings
lukasolson Jul 26, 2021
898db15
Remove isWarningResponse
lukasolson Jul 26, 2021
73e0eb0
Merge branch 'search-handle-warnings' of github.com:lukasolson/kibana…
lukasolson Jul 26, 2021
2d6ab50
Merge branch 'master' into search-handle-warnings
kibanamachine Aug 2, 2021
671aeed
Merge branch 'master' into search-handle-warnings
lukasolson Aug 2, 2021
033a84d
Merge branch 'master' into search-handle-warnings
kibanamachine Aug 5, 2021
056f6d0
Merge branch 'master' into search-handle-warnings
lukasolson Aug 5, 2021
d386872
Merge branch 'search-handle-warnings' of github.com:lukasolson/kibana…
lukasolson Aug 5, 2021
20dd68a
Merge branch 'master' into search-handle-warnings
kibanamachine Aug 10, 2021
774373c
Merge branch 'master' into search-handle-warnings
kibanamachine Aug 12, 2021
675e584
Merge branch 'master' into search-handle-warnings
kibanamachine Aug 16, 2021
901870a
Merge branch 'search-handle-warnings' of github.com:lukasolson/kibana…
lukasolson Aug 16, 2021
d0db0f3
Merge branch 'master' into search-handle-warnings
lukasolson Aug 16, 2021
7ab5241
Merge remote-tracking branch 'upstream/master'
lukasolson Aug 19, 2021
913d178
Merge remote-tracking branch 'upstream/master'
lukasolson Aug 19, 2021
da702fe
Remove deprecated courier:batchSearches advanced setting
lukasolson Aug 19, 2021
35096bf
Update docs
lukasolson Aug 19, 2021
e160be3
Remove legacy tests
lukasolson Aug 20, 2021
3d725a3
Merge branch 'master' into remove-batch-searches
kibanamachine Aug 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ UI_SETTINGS: {
readonly COURIER_SET_REQUEST_PREFERENCE: "courier:setRequestPreference";
readonly COURIER_CUSTOM_REQUEST_PREFERENCE: "courier:customRequestPreference";
readonly COURIER_MAX_CONCURRENT_SHARD_REQUESTS: "courier:maxConcurrentShardRequests";
readonly COURIER_BATCH_SEARCHES: "courier:batchSearches";
readonly SEARCH_INCLUDE_FROZEN: "search:includeFrozen";
readonly SEARCH_TIMEOUT: "search:timeout";
readonly HISTOGRAM_BAR_TARGET: "histogram:barTarget";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ UI_SETTINGS: {
readonly COURIER_SET_REQUEST_PREFERENCE: "courier:setRequestPreference";
readonly COURIER_CUSTOM_REQUEST_PREFERENCE: "courier:customRequestPreference";
readonly COURIER_MAX_CONCURRENT_SHARD_REQUESTS: "courier:maxConcurrentShardRequests";
readonly COURIER_BATCH_SEARCHES: "courier:batchSearches";
readonly SEARCH_INCLUDE_FROZEN: "search:includeFrozen";
readonly SEARCH_TIMEOUT: "search:timeout";
readonly HISTOGRAM_BAR_TARGET: "histogram:barTarget";
Expand Down
8 changes: 0 additions & 8 deletions docs/management/advanced-options.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -398,14 +398,6 @@ changes.
[[kibana-search-settings]]
==== Search

[horizontal]
[[courier-batchsearches]]`courier:batchSearches`::
**Deprecated in 7.6. Starting in 8.0, this setting will be optimized internally.**
When disabled, dashboard panels will load individually, and search requests will
terminate when users navigate away or update the query. When enabled, dashboard
panels will load together when all of the data is loaded, and searches will not
terminate.

[[courier-customrequestpreference]]`courier:customRequestPreference`::
{ref}/search-request-body.html#request-body-search-preference[Request preference]
to use when `courier:setRequestPreference` is set to "custom".
Expand Down
1 change: 0 additions & 1 deletion src/plugins/data/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ export const UI_SETTINGS = {
COURIER_SET_REQUEST_PREFERENCE: 'courier:setRequestPreference',
COURIER_CUSTOM_REQUEST_PREFERENCE: 'courier:customRequestPreference',
COURIER_MAX_CONCURRENT_SHARD_REQUESTS: 'courier:maxConcurrentShardRequests',
COURIER_BATCH_SEARCHES: 'courier:batchSearches',
SEARCH_INCLUDE_FROZEN: 'search:includeFrozen',
SEARCH_TIMEOUT: 'search:timeout',
HISTOGRAM_BAR_TARGET: 'histogram:barTarget',
Expand Down
1 change: 0 additions & 1 deletion src/plugins/data/common/search/search_source/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ export { extractReferences } from './extract_references';
export { parseSearchSourceJSON } from './parse_json';
export { getResponseInspectorStats } from './inspect';
export * from './fetch';
export * from './legacy';
export * from './search_source';
export * from './search_source_service';
export * from './types';
9 changes: 0 additions & 9 deletions src/plugins/data/common/search/search_source/legacy/index.ts

This file was deleted.

29 changes: 0 additions & 29 deletions src/plugins/data/common/search/search_source/legacy/types.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@

import { of } from 'rxjs';
import { IndexPattern } from '../../index_patterns';
import { GetConfigFn } from '../../types';
import { SearchSource, SearchSourceDependencies, SortDirection } from './';
import { AggConfigs, AggTypesRegistryStart, ES_SEARCH_STRATEGY } from '../../';
import { AggConfigs, AggTypesRegistryStart } from '../../';
import { mockAggTypesRegistry } from '../aggs/test_helpers';
import { RequestResponder } from 'src/plugins/inspector/common';
import { switchMap } from 'rxjs/operators';
Expand Down Expand Up @@ -953,45 +952,6 @@ describe('SearchSource', () => {
});

describe('fetch$', () => {
describe('#legacy COURIER_BATCH_SEARCHES', () => {
beforeEach(() => {
searchSourceDependencies = {
...searchSourceDependencies,
getConfig: jest.fn(() => {
return true; // batchSearches = true
}) as GetConfigFn,
};
});

test('should override to use sync search if not set', async () => {
searchSource = new SearchSource({ index: indexPattern }, searchSourceDependencies);
const options = {};
await searchSource.fetch$(options).toPromise();

const [, callOptions] = mockSearchMethod.mock.calls[0];
expect(callOptions.strategy).toBe(ES_SEARCH_STRATEGY);
});

test('should remove searchSessionId when forcing ES_SEARCH_STRATEGY', async () => {
searchSource = new SearchSource({ index: indexPattern }, searchSourceDependencies);
const options = { sessionId: 'test' };
await searchSource.fetch$(options).toPromise();

const [, callOptions] = mockSearchMethod.mock.calls[0];
expect(callOptions.strategy).toBe(ES_SEARCH_STRATEGY);
expect(callOptions.sessionId).toBeUndefined();
});

test('should not override strategy if set ', async () => {
searchSource = new SearchSource({ index: indexPattern }, searchSourceDependencies);
const options = { strategy: 'banana' };
await searchSource.fetch$(options).toPromise();

const [, callOptions] = mockSearchMethod.mock.calls[0];
expect(callOptions.strategy).toBe('banana');
});
});

describe('responses', () => {
test('should return partial results', async () => {
searchSource = new SearchSource({ index: indexPattern }, searchSourceDependencies);
Expand Down
23 changes: 5 additions & 18 deletions src/plugins/data/common/search/search_source/search_source.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
*/

import { setWith } from '@elastic/safer-lodash-set';
import { uniqueId, keyBy, pick, difference, isFunction, isEqual, uniqWith, isObject } from 'lodash';
import { difference, isEqual, isFunction, isObject, keyBy, pick, uniqueId, uniqWith } from 'lodash';
import {
catchError,
finalize,
Expand All @@ -78,7 +78,6 @@ import { fieldWildcardFilter } from '../../../../kibana_utils/common';
import { IIndexPattern, IndexPattern, IndexPatternField } from '../../index_patterns';
import {
AggConfigs,
ES_SEARCH_STRATEGY,
EsQuerySortValue,
IEsSearchResponse,
ISearchGeneric,
Expand All @@ -87,26 +86,25 @@ import {
import type {
ISearchSource,
SearchFieldValue,
SearchSourceOptions,
SearchSourceFields,
SearchSourceOptions,
} from './types';
import { FetchHandlers, RequestFailure, getSearchParamsFromRequest, SearchRequest } from './fetch';
import { FetchHandlers, getSearchParamsFromRequest, RequestFailure, SearchRequest } from './fetch';
import { getRequestInspectorStats, getResponseInspectorStats } from './inspect';

import {
getEsQueryConfig,
UI_SETTINGS,
IKibanaSearchResponse,
isErrorResponse,
isPartialResponse,
IKibanaSearchResponse,
UI_SETTINGS,
} from '../../../common';
import { getHighlightRequest } from '../../../../field_formats/common';
import { extractReferences } from './extract_references';

/** @internal */
export const searchSourceRequiredUiSettings = [
'dateFormat:tz',
UI_SETTINGS.COURIER_BATCH_SEARCHES,
UI_SETTINGS.COURIER_CUSTOM_REQUEST_PREFERENCE,
UI_SETTINGS.COURIER_IGNORE_FILTER_IF_FIELD_NOT_IN_INDEX,
UI_SETTINGS.COURIER_MAX_CONCURRENT_SHARD_REQUESTS,
Expand Down Expand Up @@ -280,17 +278,6 @@ export class SearchSource {
fetch$(
options: ISearchOptions = {}
): Observable<IKibanaSearchResponse<estypes.SearchResponse<any>>> {
const { getConfig } = this.dependencies;
const syncSearchByDefault = getConfig(UI_SETTINGS.COURIER_BATCH_SEARCHES);

// Use the sync search strategy if legacy search is enabled.
// This still uses bfetch for batching.
if (!options?.strategy && syncSearchByDefault) {
options.strategy = ES_SEARCH_STRATEGY;
// `ES_SEARCH_STRATEGY` doesn't support search sessions, hence remove sessionId
options.sessionId = undefined;
}

const s$ = defer(() => this.requestIsStarting(options)).pipe(
switchMap(() => {
const searchRequest = this.flatten();
Expand Down
1 change: 0 additions & 1 deletion src/plugins/data/public/public.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -2310,7 +2310,6 @@ export const UI_SETTINGS: {
readonly COURIER_SET_REQUEST_PREFERENCE: "courier:setRequestPreference";
readonly COURIER_CUSTOM_REQUEST_PREFERENCE: "courier:customRequestPreference";
readonly COURIER_MAX_CONCURRENT_SHARD_REQUESTS: "courier:maxConcurrentShardRequests";
readonly COURIER_BATCH_SEARCHES: "courier:batchSearches";
readonly SEARCH_INCLUDE_FROZEN: "search:includeFrozen";
readonly SEARCH_TIMEOUT: "search:timeout";
readonly HISTOGRAM_BAR_TARGET: "histogram:barTarget";
Expand Down
90 changes: 0 additions & 90 deletions src/plugins/data/server/search/routes/call_msearch.test.ts

This file was deleted.

Loading