[data.search] Simplify poll logic and improve types#82545
Merged
lizozom merged 37 commits intoelastic:masterfrom Nov 24, 2020
Merged
[data.search] Simplify poll logic and improve types#82545lizozom merged 37 commits intoelastic:masterfrom
lizozom merged 37 commits intoelastic:masterfrom
Conversation
Co-authored-by: Anton Dosov <dosantappdev@gmail.com>
Contributor
|
@elasticmachine merge upstream |
2 tasks
Contributor
|
@elasticmachine merge upstream |
added 8 commits
November 22, 2020 15:13
This reverts commit 01e8a06.
lizozom
reviewed
Nov 24, 2020
| return es | ||
| .search({ ...request, params: dsl }, options, deps) | ||
| .pipe(mergeMap((esSearchRes) => queryFactory.parse(request, esSearchRes))); | ||
| return es.search({ ...request, params: dsl }, options, deps).pipe( |
Contributor
There was a problem hiding this comment.
We now shim totals in the responses in the route handler.
This means that internally, all strategies should work with the new format {value: 123, relation: 'eq'}.
We shimmed the types here to avoid test failures.
patrykkopycinski
approved these changes
Nov 24, 2020
Contributor
patrykkopycinski
left a comment
There was a problem hiding this comment.
SIEM/Endpoint LGTM
Contributor
💚 Build SucceededMetrics [docs]Module Count
Distributable file count
Page load bundle
History
To update your PR or re-run it, just comment with: |
lizozom
pushed a commit
to lizozom/kibana
that referenced
this pull request
Nov 24, 2020
* [Search] Add request context and asScoped pattern * Update docs * Unify interface for getting search client * Update examples/search_examples/server/my_strategy.ts Co-authored-by: Anton Dosov <dosantappdev@gmail.com> * Review feedback * Fix checks * Fix CI * Fix security search * Fix test * Fix test for reals * Fix types * [data.search] Refactor search polling and improve types * Fix & update tests & types * eql totals * doc * Revert "eql totals" This reverts commit 01e8a06. * lint * response type * shim inside strategies * shim for security * fix eql params Co-authored-by: Anton Dosov <dosantappdev@gmail.com> Co-authored-by: Liza K <liza.katz@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # src/plugins/data/server/index.ts # src/plugins/data/server/server.api.md
lizozom
added a commit
that referenced
this pull request
Nov 25, 2020
…84292) * [data.search] Simplify poll logic and improve types (#82545) * [Search] Add request context and asScoped pattern * Update docs * Unify interface for getting search client * Update examples/search_examples/server/my_strategy.ts Co-authored-by: Anton Dosov <dosantappdev@gmail.com> * Review feedback * Fix checks * Fix CI * Fix security search * Fix test * Fix test for reals * Fix types * [data.search] Refactor search polling and improve types * Fix & update tests & types * eql totals * doc * Revert "eql totals" This reverts commit 01e8a06. * lint * response type * shim inside strategies * shim for security * fix eql params Co-authored-by: Anton Dosov <dosantappdev@gmail.com> Co-authored-by: Liza K <liza.katz@elastic.co> Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> # Conflicts: # src/plugins/data/server/index.ts # src/plugins/data/server/server.api.md * doc Co-authored-by: Lukas Olson <olson.lukas@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR simplifies the async search polling observable and search strategy authoring.
Any new search strategy should be implementing a method that fetches partial data and formats it into a
IKibanaSearchResponse.pollSearchwill periodically call this method, until response is complete or until an error or an abort have occurred.For example:
Checklist
Delete any items that are not applicable to this PR.
For maintainers