forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SEARCH] Cleanup fetch soon (elastic#63320)
* move old code to legacy folder * Use search service directly from search source * Move get search params to fetch folder * Delete search strategy folder * Doc update * Minor cleanups * Moved es client to legacy folder * Clean up some unused code (isViable, old search function) * Updated tests * strings update * Fix jest test * re-arrange runSearch function * re-arrange runSearch function * fix jest tests Co-authored-by: Elastic Machine <[email protected]>
- Loading branch information
1 parent
40be0fe
commit 8fdc7ed
Showing
36 changed files
with
276 additions
and
322 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 0 additions & 11 deletions
11
...gins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.id.md
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
...ata/public/kibana-plugin-plugins-data-public.searchstrategyprovider.isviable.md
This file was deleted.
Oops, something went wrong.
20 changes: 0 additions & 20 deletions
20
...plugins/data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.md
This file was deleted.
Oops, something went wrong.
11 changes: 0 additions & 11 deletions
11
.../data/public/kibana-plugin-plugins-data-public.searchstrategyprovider.search.md
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
src/plugins/data/public/search/fetch/get_search_params.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* Licensed to Elasticsearch B.V. under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch B.V. licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
|
||
import { getSearchParams } from './get_search_params'; | ||
import { IUiSettingsClient } from 'kibana/public'; | ||
|
||
function getConfigStub(config: any = {}) { | ||
return { | ||
get: key => config[key], | ||
} as IUiSettingsClient; | ||
} | ||
|
||
describe('getSearchParams', () => { | ||
test('includes rest_total_hits_as_int', () => { | ||
const config = getConfigStub(); | ||
const searchParams = getSearchParams(config); | ||
expect(searchParams.rest_total_hits_as_int).toBe(true); | ||
}); | ||
|
||
test('includes ignore_unavailable', () => { | ||
const config = getConfigStub(); | ||
const searchParams = getSearchParams(config); | ||
expect(searchParams.ignore_unavailable).toBe(true); | ||
}); | ||
|
||
test('includes ignore_throttled according to search:includeFrozen', () => { | ||
let config = getConfigStub({ 'search:includeFrozen': true }); | ||
let searchParams = getSearchParams(config); | ||
expect(searchParams.ignore_throttled).toBe(false); | ||
|
||
config = getConfigStub({ 'search:includeFrozen': false }); | ||
searchParams = getSearchParams(config); | ||
expect(searchParams.ignore_throttled).toBe(true); | ||
}); | ||
|
||
test('includes max_concurrent_shard_requests according to courier:maxConcurrentShardRequests', () => { | ||
let config = getConfigStub({ 'courier:maxConcurrentShardRequests': 0 }); | ||
let searchParams = getSearchParams(config); | ||
expect(searchParams.max_concurrent_shard_requests).toBe(undefined); | ||
|
||
config = getConfigStub({ 'courier:maxConcurrentShardRequests': 5 }); | ||
searchParams = getSearchParams(config); | ||
expect(searchParams.max_concurrent_shard_requests).toBe(5); | ||
}); | ||
|
||
test('includes timeout according to esShardTimeout if greater than 0', () => { | ||
const config = getConfigStub(); | ||
let searchParams = getSearchParams(config, 0); | ||
expect(searchParams.timeout).toBe(undefined); | ||
|
||
searchParams = getSearchParams(config, 100); | ||
expect(searchParams.timeout).toBe('100ms'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.