-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Use Search API in Vega #68257
Use Search API in Vega #68257
Conversation
@elasticmachine merge upstream |
merge conflict between base and head |
# Conflicts: # src/plugins/data/public/search/fetch/get_search_params.ts
Pinging @elastic/kibana-app (Team:KibanaApp) |
@elasticmachine merge upstream |
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.
Added a couple of comments on implementation.
Didn't test Vega yet.
maxAge: 4 * 1000, | ||
}); | ||
if (!searchAPI) { | ||
searchAPI = new SearchAPI({ search: getData().search }, abortSignal); |
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.
Why do you need getData
if this function gets data plugin as a dependency?
@@ -171,6 +172,13 @@ export class SearchService implements Plugin<ISearchSetup, ISearchStart> { | |||
return new SearchSource({}, searchSourceDependencies); | |||
}, | |||
}, | |||
searchParams: { |
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.
I think it would be really simple to add this function as a utility, passing in core
from the caller.
I don't see any reason to have this as part of the contract, as it's only used to migrate old requests to the new search service format, and won't be a part of the API long term
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.
@liza-mae np, will move it into static contract. My idea was to bind the required dependencies...
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.
Wrong liza :)
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.
=)
@@ -53,3 +54,18 @@ export function getPreference(config: IUiSettingsClient) { | |||
export function getTimeout(esShardTimeout: number) { | |||
return esShardTimeout > 0 ? `${esShardTimeout}ms` : undefined; | |||
} | |||
|
|||
export function getSearchParamsFromRequest( |
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.
Thanks for adding this!
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.
LGTM for SOM plugin changes
"searchParams": Object { | ||
"createFromRequest": [MockFunction], | ||
}, |
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.
That's not the first PR that is forced to update this snapshot. This should not be needed. Gonna fix the test to just assert existence of the Flyout
component. Snapshot testing the props has really low value here, and behavior is already covered in FTR test anyway
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.
Created #68489
@@ -641,6 +642,23 @@ export function getQueryLog(uiSettings: IUiSettingsClient, storage: IStorageWrap | |||
// @public (undocumented) | |||
export function getSearchErrorType({ message }: Pick<SearchError, 'message'>): "UNSUPPORTED_QUERY" | undefined; | |||
|
|||
// Warning: (ae-missing-release-tag) "getSearchParamsFromRequest" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal) |
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.
Maybe mark this as @internal?
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.
@lizozom not sure, becase we use it at least in 2 different plugins: data, vis_type_vega
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.
LGTM
Haven't checked out to test
# Conflicts: # src/plugins/data/public/public.api.md
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
ping @elastic/kibana-app |
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.
Code LGTM, have tested it on chrome, safari and ff. Old vega visualizations work as expected and also new ones.
* Use Search API in Vega * fix PR comments * fix PR comments
* Use Search API in Vega * fix PR comments * fix PR comments Co-authored-by: Elastic Machine <[email protected]>
* master: (22 commits) Partial revert of "Sync Kerberos + Anonymous access tests with the latest `security/_authenticate` API (user roles now include roles of anonymous user)." (elastic#68624) adapt some snapshot test (elastic#68489) [APM] Service maps - Fix missing ML status for services with jobs but no anomalies (elastic#68486) [skip test] apis Kerberos security Kerberos authentication finishing SPNEGO should properly set cookie and authenticate user [SIEM][Exceptions] - ExceptionsViewer UI component part 2 (elastic#68294) Surface data streams in Index Management. (elastic#67806) Fix edit datasource not working following changes in elastic#67234 (elastic#68583) [Logs + Metrics UI] Clean up async plugin initialization (elastic#67654) APM Storybook fixes (elastic#68671) Upgrade EUI to v24.1.0 (elastic#68141) [ML] DF Analytics: Creation wizard part 2 (elastic#68462) [Uptime] Fix race on overview page query (elastic#67843) Prefer using npm_execpath when spawning Yarn (elastic#68673) [Security] [Cases] Attach timeline to existing case (elastic#68580) Use Search API in Vega (elastic#68257) [Component templates] Table view (elastic#68031) [Uptime] Added relative date info in cert status column (elastic#67612) [Endpoint] Re-enable Functional test case for Endpoint related pages (elastic#68445) run page_load_metrics tests in visual regresssion jobs (elastic#68570) Enable exhaustive-deps; correct any lint warnings (elastic#68453) ...
Closes: #67584
Summary
The old elasticsearch client is deprecated and we need to switch away from it. We should use App Arch's Search API instead to send the raw DSL in Vega.
Checklist
Delete any items that are not applicable to this PR.
For maintainers