-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[Search service] Add enhanced ES search strategy #59224
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
Merged
Merged
Changes from all commits
Commits
Show all changes
116 commits
Select commit
Hold shift + click to select a range
02c57f3
Add async search strategy
lukasolson 41b7c6a
Add async search
lukasolson cf5ceb9
Fix async strategy and add tests
lukasolson 5ad5b36
Merge branch 'master' into asyncSearch
lukasolson 2009343
Move types to separate file
lukasolson ebebdaf
Revert changes to demo search
lukasolson 65c39b6
Merge branch 'master' into asyncSearch
lukasolson 5dd876f
Update demo search strategy to use async
lukasolson d487812
Add async es search strategy
lukasolson 7433aa6
Return response as rawResponse
lukasolson 93ea93e
Poll after initial request
lukasolson 8e8eb7b
Merge branch 'master' into asyncSearch
lukasolson f15c4af
Merge branch 'master' into enhancedEsSearch
lukasolson 50b4b69
Merge branch 'master' into asyncSearch
lukasolson 2bed4a6
Merge branch 'master' into asyncSearch
lukasolson b6d9c25
Merge branch 'asyncSearch' into enhancedEsSearch
lukasolson 7260761
Add cancellation to search strategies
lukasolson be300db
Add tests
lukasolson fa02de6
Merge branch 'master' into asyncSearch
lukasolson 4e524d1
Merge branch 'asyncSearch' into enhancedEsSearch
lukasolson 7ad5755
Merge branch 'master' into asyncSearch
lukasolson e4eb651
Simplify async search strategy
lukasolson b6a7f5e
Merge branch 'asyncSearch' into enhancedEsSearch
lukasolson 6188c74
Move loadingCount to search strategy
lukasolson 765ec61
Merge branch 'loadingCount' into asyncSearch
lukasolson b35ca0f
Merge branch 'asyncSearch' into enhancedEsSearch
lukasolson f15f138
Update abort controller library
lukasolson 4d36124
Bootstrap
lukasolson 1943855
Merge branch 'master' into abortController
elasticmachine c7e328c
Merge branch 'master' into asyncSearch
elasticmachine 491e8bb
Abort when the request is aborted
lukasolson d5d995c
Merge branch 'master' into abortController
lukasolson 8afc936
Merge branch 'abortController' of github.com:lukasolson/kibana into a…
lukasolson 48238d8
Merge branch 'abortController' into abortSearch
lukasolson 0db7257
Add utility and update value suggestions route
lukasolson 2f00b41
Merge branch 'master' into asyncSearch
lukasolson b8711ca
Merge branch 'abortController' into asyncSearch
lukasolson f02792f
Fix bad merge conflict
lukasolson 30886d1
Merge branch 'abortController' into asyncSearch
lukasolson 2cb8dd4
Update tests
lukasolson 229af5a
Merge remote-tracking branch 'origin/asyncSearch' into asyncSearch
lukasolson 2a53834
Move to data_enhanced plugin
lukasolson 3a6dd41
Merge branch 'asyncSearch' into enhancedEsSearch
lukasolson f376da7
Merge branch 'master' into abortSearch
lukasolson ad5f188
Remove bad merge
lukasolson 48b88c0
Revert switching abort controller libraries
lukasolson 21dd1c8
Revert package.json in lib
lukasolson 16064ff
Merge branch 'revertAbortController' into abortSearch
lukasolson a079c15
Merge branch 'master' into revertAbortController
elasticmachine 0b87a0b
Move to previous abort controller
lukasolson 55d76f3
Merge branch 'master' into abortSearch
lukasolson 1aa401d
Merge branch 'master' into asyncSearch
lukasolson 7cd1092
Merge branch 'asyncSearch' into enhancedEsSearch
lukasolson 8292c1e
Merge branch 'master' into revertAbortController
lukasolson e45bdd6
Merge remote-tracking branch 'origin/revertAbortController' into reve…
lukasolson d3291a8
Merge branch 'master' into revertAbortController
elasticmachine 599c564
Merge branch 'master' into enhancedEsSearch
elasticmachine c25d3a9
Merge branch 'master' into asyncSearch
elasticmachine f996a65
Merge branch 'master' into abortSearch
lukasolson 91655f2
Merge branch 'abortSearch' into asyncSearch
lukasolson 8447981
Merge branch 'asyncSearch' of github.com:lukasolson/kibana into async…
lukasolson 4badc14
Merge branch 'master' into revertAbortController
lukasolson 6df7a41
Merge branch 'asyncSearch' into enhancedEsSearch
lukasolson 7dc053e
Merge branch 'enhancedEsSearch' of github.com:lukasolson/kibana into …
lukasolson e959aad
Add support for frozen indices
lukasolson c9352e3
Merge branch 'master' into revertAbortController
lukasolson 100a728
Merge branch 'revertAbortController' into abortSearch
lukasolson 35b1abb
Fix test to use fake timers to run debounced handlers
lukasolson 84bda2e
Merge branch 'abortSearch' into asyncSearch
lukasolson 8822ec8
Merge branch 'asyncSearch' into enhancedEsSearch
lukasolson 0db590e
Merge branch 'master' into abortSearch
lukasolson b2ebe1e
Merge branch 'master' into asyncSearch
lukasolson 5ec9c30
Merge branch 'master' into enhancedEsSearch
lukasolson 6cff829
Merge branch 'master' into abortSearch
lukasolson 831cb9f
Merge branch 'master' into asyncSearch
lukasolson d71d900
Revert changes to example plugin
lukasolson 914d330
Fix loading bar not going away when cancelling
lukasolson fb5ef63
Merge branch 'master' into abortSearch
lukasolson df1fa5e
Merge branch 'abortSearch' into asyncSearch
lukasolson 07b6903
Merge branch 'asyncSearch' into enhancedEsSearch
lukasolson c8c1a95
Merge branch 'master' into abortSearch
lukasolson 6a6df45
Merge branch 'master' into asyncSearch
lukasolson d8fd759
Call getSearchStrategy instead of passing directly
lukasolson b7407ea
Merge branch 'master' into asyncSearch
lukasolson e6f11db
Add async demo search strategy
lukasolson 9337dea
Fix error with setting state
lukasolson 365ace1
Merge branch 'master' into abortSearch
elasticmachine f0c2c9c
Merge branch 'master' into abortSearch
elasticmachine a6921d7
Merge branch 'master' into asyncSearch
lukasolson 4267bf2
Update how aborting works
lukasolson 418e4a1
Fix type checks
lukasolson 159f5f0
Add test for loading count
lukasolson 5bbae56
Merge remote-tracking branch 'origin/abortSearch' into abortSearch
lukasolson 71ca887
Merge branch 'master' into asyncSearch
lukasolson dae93b1
Attempt to fix broken example test
lukasolson 7f55c43
Merge branch 'master' into abortSearch
lukasolson 248e094
Merge branch 'master' into asyncSearch
lukasolson 1da1ce0
Revert changes to test
lukasolson ae16a51
Merge branch 'master' into asyncSearch
elasticmachine efa6cf6
Fix test
lukasolson cdb5417
Update name to camelCase
lukasolson b38d45d
Merge branch 'asyncSearch' of github.com:lukasolson/kibana into async…
lukasolson 2ec0d0b
Fix failing test
lukasolson 168ccc7
Merge branch 'abortSearch' into asyncSearch
lukasolson 4325fec
Don't require data_enhanced in example plugin
lukasolson df2c99d
Merge branch 'asyncSearch' into enhancedEsSearch
lukasolson 1f99f21
Actually send DELETE request
lukasolson 74b3718
Use waitForCompletion parameter
lukasolson e30e047
Use default search params
lukasolson e45021c
Add support for rollups
lukasolson b71c661
Merge branch 'master' into enhancedEsSearch
lukasolson 20ce66a
Only make changes needed for frozen indices/rollups
lukasolson eaffdb5
Merge branch 'master' into enhancedEs
lukasolson e0ce774
Fix tests/types
lukasolson 7f6ed11
Merge branch 'master' into enhancedEs
lukasolson 9842cff
Don't include skipped in loaded/total
lukasolson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,21 @@ | ||
| /* | ||
| * 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. | ||
| */ | ||
|
|
||
| export { esSearchStrategyProvider } from './es_search_strategy'; | ||
| export { getEsPreference } from './get_es_preference'; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
28 changes: 28 additions & 0 deletions
28
src/plugins/data/server/search/es_search/get_default_search_params.ts
This file contains hidden or 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,28 @@ | ||
| /* | ||
| * 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 { SharedGlobalConfig } from '../../../../../core/server'; | ||
|
|
||
| export function getDefaultSearchParams(config: SharedGlobalConfig) { | ||
| return { | ||
| timeout: `${config.elasticsearch.shardTimeout.asMilliseconds()}ms`, | ||
| ignoreUnavailable: true, // Don't fail if the index/indices don't exist | ||
| restTotalHitsAsInt: true, // Get the number of hits as an int rather than a range | ||
| }; | ||
| } |
This file contains hidden or 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 hidden or 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 hidden or 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,7 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| export { EnhancedSearchParams, IEnhancedEsSearchRequest } from './search'; |
This file contains hidden or 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,7 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| export { EnhancedSearchParams, IEnhancedEsSearchRequest } from './types'; |
This file contains hidden or 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,19 @@ | ||
| /* | ||
| * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
| * or more contributor license agreements. Licensed under the Elastic License; | ||
| * you may not use this file except in compliance with the Elastic License. | ||
| */ | ||
|
|
||
| import { SearchParams } from 'elasticsearch'; | ||
| import { IEsSearchRequest } from '../../../../../src/plugins/data/common'; | ||
|
|
||
| export interface EnhancedSearchParams extends SearchParams { | ||
| ignoreThrottled: boolean; | ||
| } | ||
|
|
||
| export interface IEnhancedEsSearchRequest extends IEsSearchRequest { | ||
| /** | ||
| * Used to determine whether to use the _rollups_search or a regular search endpoint. | ||
| */ | ||
| isRollup?: boolean; | ||
| } |
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -8,6 +8,6 @@ | |
| "requiredPlugins": [ | ||
| "data" | ||
| ], | ||
| "server": false, | ||
| "server": true, | ||
| "ui": true | ||
| } | ||
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ICancel sounds a bit too generic in the context of the data plugin.
I thing all of these types should have the
ISearchprefixThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ We can address this in a follow-up PR