[Partial Results] Move other bucket into Search Source#96384
[Partial Results] Move other bucket into Search Source#96384lizozom merged 34 commits intoelastic:masterfrom
Conversation
…tor-integration-in-search-source
…tor-integration-in-search-source
|
@elasticmachine merge upstream |
|
merge conflict between base and head |
| if (responseAgg[aggWithOtherBucket.id]) { | ||
| return responseAgg[aggWithOtherBucket.id].buckets; | ||
| if (responseAgg?.[aggWithOtherBucket.id]) { | ||
| return (responseAgg[aggWithOtherBucket.id] as any).buckets; |
There was a problem hiding this comment.
Introduced response typing, but I don't want to broaden the refactoring of this code
ts improvements more inspector tests
more tests
|
@elasticmachine merge upstream |
|
@lizozom can you add a screenshot of the resulting UI? It will help with the quick design review, thanks. |
|
@ryankeairns I don't think this deserves a review honestly. |
…into search/move-other-bucket
|
@elasticmachine merge upstream |
…into search/move-other-bucket
* Move inspector adapter integration into search source * docs and ts * Move other bucket to search source * test ts + delete unused tabilfy function * hierarchical param in aggconfig. ts improvements more inspector tests * fix jest * separate inspect more tests * jest * inspector * Error handling and more tests * put the fun in functional tests * code review * Add functional test for other bucket in search example app * test * test * ts * test * test * ts Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
* Move inspector adapter integration into search source * docs and ts * Move other bucket to search source * test ts + delete unused tabilfy function * hierarchical param in aggconfig. ts improvements more inspector tests * fix jest * separate inspect more tests * jest * inspector * Error handling and more tests * put the fun in functional tests * code review * Add functional test for other bucket in search example app * test * test * ts * test * test * ts Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Liza Katz <lizka.k@gmail.com>
💚 Build SucceededMetrics [docs]Async chunks
Page load bundle
Unknown metric groupsAPI count
API count missing comments
API count with any type
History
To update your PR or re-run it, just comment with: cc @lizozom |
…te-legacy-es-client * 'master' of github.com:elastic/kibana: (102 commits) [Exploratory view] integerate page views to exploratory view (elastic#97258) Fix typo in license_api_guard README name and import http server mocks from public interface (elastic#97334) Avoid mutating KQL query when validating it (elastic#97081) Add description as title on tag badge (elastic#97109) Remove legacy ES client usages in `home` and `xpack_legacy` (elastic#97359) [Fleet] Finer-grained error information from install/upgrade API (elastic#95649) Rule registry bundle size (elastic#97251) [Partial Results] Move other bucket into Search Source (elastic#96384) [Dashboard] Makes lens default editor for creating new panels (elastic#96181) skip flaky suite (elastic#97387) [Asset Management] Agent picker follow up (elastic#97357) skip flaky suite (elastic#97382) [Security Solutions] Fixes flake with cypress tests (elastic#97329) skip flaky suite (elastic#97355) Skip test to try and stabilize master minimize number of so fild asserted in tests. it creates flakines when implementation details change (elastic#97374) [Search Sessions] Client side search cache (elastic#92439) [SavedObjects] Add aggregations support (elastic#96292) [Reporting] Remove legacy elasticsearch client usage from the reporting plugin (elastic#97184) [kbnClient] fix basePath handling and export reponse type (elastic#97277) ... # Conflicts: # x-pack/plugins/watcher/server/lib/license_pre_routing_factory/license_pre_routing_factory.ts # x-pack/plugins/watcher/server/plugin.ts # x-pack/plugins/watcher/server/routes/api/indices/register_get_route.ts # x-pack/plugins/watcher/server/routes/api/license/register_refresh_route.ts # x-pack/plugins/watcher/server/routes/api/register_list_fields_route.ts # x-pack/plugins/watcher/server/routes/api/register_load_history_route.ts # x-pack/plugins/watcher/server/routes/api/settings/register_load_route.ts # x-pack/plugins/watcher/server/routes/api/watch/action/register_acknowledge_route.ts # x-pack/plugins/watcher/server/routes/api/watch/register_activate_route.ts # x-pack/plugins/watcher/server/routes/api/watch/register_deactivate_route.ts # x-pack/plugins/watcher/server/routes/api/watch/register_delete_route.ts # x-pack/plugins/watcher/server/routes/api/watch/register_execute_route.ts # x-pack/plugins/watcher/server/routes/api/watch/register_history_route.ts # x-pack/plugins/watcher/server/routes/api/watch/register_load_route.ts # x-pack/plugins/watcher/server/routes/api/watch/register_save_route.ts # x-pack/plugins/watcher/server/routes/api/watch/register_visualize_route.ts # x-pack/plugins/watcher/server/routes/api/watches/register_delete_route.ts # x-pack/plugins/watcher/server/routes/api/watches/register_list_route.ts # x-pack/plugins/watcher/server/shared_imports.ts # x-pack/plugins/watcher/server/types.ts
Summary
Depends on #96241
When an aggregation has an
otherbucket, one or morepost flight requestsare needed to construct it.Previously, that logic was part of the request handler code, making it available to
expressions, but not to direct consumers ofSearchSource.This PR:
AggConfigsobject intosearchSource.setField('aggs', ...).aggConfigs.toDslhierarchicaloption toAggConfigs, replacing the previous parameterpostFlightRequestsinto search source.Response
The search observable returned from
searchSource.fetch$()generally emits one or more responses (all but the last one being partial results). If theAggConfigspassed to thesearchSourcegeneratepostFlightRequests, thesearchSourcewill emit an additional single response (even if it required multiple calls), with the other bucket fully populated.Release Note
Adds Other Bucket support to
SearchSource, by passing in anAggConfigsobject directly tosearchSource.setField('aggs', aggs).The search observable returned from
searchSource.fetch$()will emit one or more responses (all but the last one being partial results). If theAggConfigspassed to thesearchSourcegeneratepostFlightRequests, thesearchSourcewill emit an additional single response (even if it required multiple calls), with the other bucket fully populated.Tests
These changes effect any consumers of
SearchSource, with or without theOtherbucket, i.e. apps like Dashboard, Visualizations, Lens and Maps. Consumers of the lower leveldata.searchAPI should not be effected by this PR.Special attention should be given to testing the
Otherbucket,hierarchicalparameter (formerly known asmetricsAtAllLevels) and the behavior of theinspectorin the above scenarios.Unit tests
_terms_other_bucket_helper.test.ts'setField(aggs)'- adjust aggs type'calls searchSource.fetch'- adjust inspector format'calls agg.postFlightRequest if it exiests and agg is enabled''should skip agg.postFlightRequest call if the agg is disabled'tabifies response data- removedmetricsAtAllLevelsisPartialandisRunningin response mockaggsrequired adjustmentsfetch$instead of deprecatedfetchsets the value for the property with AggConfigsfetch$shareReplays resultshould emit error on empty responseinspectorcalls inspector if providedcalls inspector only once, with multiple subs (shareReplay)calls error on inspectorpostFlightRequestdoesnt call any post flight requests if disableddoesnt call any post flight if searchsource has errorcalls post flight requests, fires 1 extra response, returns last responsecalls post flight requests, handles errorhierarchical: trueFunctional tests
otherbucket in the final response.Checklist
Delete any items that are not applicable to this PR.
For maintainers