Skip to content
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

[data.search.searchSource] Add fetch$ observable for partial results #89211

Merged
merged 7 commits into from
Jan 29, 2021

Conversation

lukasolson
Copy link
Member

@lukasolson lukasolson commented Jan 25, 2021

Summary

Resolves #82887.

Adds a fetch$ method in SearchSource that enables consumers to get partial results instead of only the final response.

Checklist

For maintainers

Plugin API Changes

The data plugin search service SearchSource now provides a fetch$ method in addition to the existing fetch method that returns an Observable over all responses returned. This is useful when _async_search is being used and the consumer needs to handle partial search responses.

Copy link
Contributor

@lizozom lizozom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks perfect, I'd update the tests to verify behavior with partial results

@lukasolson lukasolson marked this pull request as ready for review January 26, 2021 23:42
@lukasolson lukasolson requested a review from a team as a code owner January 26, 2021 23:42
@lukasolson lukasolson self-assigned this Jan 26, 2021
@lukasolson lukasolson added Feature:Search Querying infrastructure in Kibana Project:AsyncSearch Background search, partial results, async search services. release_note:skip Skip the PR/issue when compiling release notes review Team:AppServices v7.12.0 v8.0.0 labels Jan 26, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-app-services (Team:AppServices)

@lukasolson lukasolson added release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. and removed release_note:skip Skip the PR/issue when compiling release notes labels Jan 26, 2021
})
);
}

/**
* Fetch this source and reject the returned Promise on error
*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we maybe add @deprecated to this?

@@ -305,16 +308,16 @@ export class SearchSource {
* Run a search using the search service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this block can be deleted from a private fn?

Copy link
Contributor

@lizozom lizozom left a 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 documentation comments.
Overall LGTM

Copy link
Member

@ppisljar ppisljar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code LGTM

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
data 799.0KB 799.3KB +269.0B

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@lukasolson lukasolson merged commit d7b1cbb into elastic:master Jan 29, 2021
lukasolson added a commit to lukasolson/kibana that referenced this pull request Jan 29, 2021
…lastic#89211)

* [data.search.searchSource] Add fetch$ observable for partial results

* Fix mocks & add tests

* Update docs

* Update docs

* Review feedback
lukasolson added a commit that referenced this pull request Jan 29, 2021
…89211) (#89754)

* [data.search.searchSource] Add fetch$ observable for partial results

* Fix mocks & add tests

* Update docs

* Update docs

* Review feedback

Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Search Querying infrastructure in Kibana Project:AsyncSearch Background search, partial results, async search services. release_note:plugin_api_changes Contains a Plugin API changes section for the breaking plugin API changes section. review v7.12.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data.search.searchSource] Introduce fetch$ observable.
5 participants