-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Background search service POC #64641
Background search service POC #64641
Conversation
@@ -23,4 +23,6 @@ import { CoreSetup, SharedGlobalConfig } from '../../../../core/server'; | |||
export interface ISearchContext { | |||
core: CoreSetup; | |||
config$: Observable<SharedGlobalConfig>; | |||
backgroundSearchService?: any; |
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.
How to extend context??
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.
@@ -139,6 +140,15 @@ export class SearchSource { | |||
return { ...this.fields }; | |||
} | |||
|
|||
getSessionId(): string | undefined { |
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.
Can be private
const response = await context.search!.search( | ||
searchRequest, | ||
{ signal, rawRequest: request }, | ||
strategy |
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.
Should strategy be a part of options?
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.
FWIW it would make sense as an option to me instead of its own argument (and uses the default strategy if left empty), but 🤷♂️
const user = context?.security?.authc.getCurrentUser(options.rawRequest); | ||
if (user) { | ||
context.backgroundSearchService.trackId( | ||
user.email, |
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.
Is user.email the best info to use (in terms of uniqueness)?
@@ -71,14 +106,16 @@ async function asyncSearch( | |||
const path = encodeURI(request.id ? `/_async_search/${request.id}` : `/${index}/_async_search`); | |||
|
|||
// Wait up to 1s for the response to return | |||
const query = toSnakeCase({ waitForCompletionTimeout: '1s', ...queryParams }); | |||
const query = toSnakeCase({ waitForCompletionTimeout: '1ms', ...queryParams }); |
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.
Revert me!
@elasticmachine merge upstream |
…ound-search-service
…ound-search-service
Unit tests for background_session_service Remove (temporarily) version handling
…ound-search-service
…ng notifucation, standalone session service
…ound-search-service
Add session ID to dashboard URL Reduce store interval
Added better notifications Added basic docs to service
…ound-search-service
x-pack/plugins/data_enhanced/public/background_session/background_session_service.ts
Outdated
Show resolved
Hide resolved
…ound-search-service
…ound-search-service
…ound-search-service
…ound-search-service
…ound-search-service
…ound-search-service
@@ -98,7 +83,7 @@ export class SearchInterceptor { | |||
): Observable<IEsSearchResponse> { | |||
const { id, ...searchRequest } = request; | |||
const path = trimEnd(`/internal/search/${strategy || ES_SEARCH_STRATEGY}/${id || ''}`, '/'); | |||
const body = JSON.stringify(id != null ? {} : searchRequest); | |||
const body = JSON.stringify(id != null ? { stored: request.stored } : searchRequest); |
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.
TODO: Need to make sure that searchRequest
has the correct shape, rather than making these decidions in the OSS interceptor
…ound-search-service
…ound-search-service
💔 Build Failed
Failed CI Steps
Test FailuresX-Pack Jest Tests.x-pack/plugins/data_enhanced/public/search.EnhancedSearchInterceptor search should resolve immediately if first call returns full resultStandard Out
Stack Trace
X-Pack Jest Tests.x-pack/plugins/data_enhanced/public/search.EnhancedSearchInterceptor search should make secondary request if first call returns partial resultStandard Out
Stack Trace
X-Pack Jest Tests.x-pack/plugins/data_enhanced/public/search.EnhancedSearchInterceptor search should abort if request is partial and not running (ES graceful error)Standard Out
Stack Trace
and 12 more failures, only showing the first 3. Build metrics@kbn/optimizer bundle module count
page load bundle size
Saved Objects .kibana field count
History
To update your PR or re-run it, just comment with: |
Summary
Summarize your PR. If it involves visual changes include a screenshot or gif.
Checklist
Delete any items that are not applicable to this PR.
For maintainers