This repository was archived by the owner on Sep 10, 2024. It is now read-only.
Use Kibana data plugin and search strategy#27
Draft
inge4pres wants to merge 3 commits intofg/types-refactorfrom
Draft
Use Kibana data plugin and search strategy#27inge4pres wants to merge 3 commits intofg/types-refactorfrom
inge4pres wants to merge 3 commits intofg/types-refactorfrom
Conversation
added 3 commits
March 4, 2022 19:52
Signed-off-by: inge4pres <francesco.gualazzi@elastic.co>
Signed-off-by: inge4pres <francesco.gualazzi@elastic.co>
Signed-off-by: inge4pres <francesco.gualazzi@elastic.co>
09d07f2 to
9d3f241
Compare
Author
|
@jbcrail @rockdaboot I just updated the PR as we discussed earlier. |
rockdaboot
reviewed
Mar 7, 2022
| es.search( | ||
| { | ||
| params: { | ||
| index: downsampledIndex + initialExp, |
There was a problem hiding this comment.
downsampleIndex sounds as if it holds an index name, which is not true - it only holds the prefix. To help understanding the code, I suggest using a function getDownsampledIndex(initialExp).
rockdaboot
reviewed
Mar 7, 2022
| const initialExp = 6; | ||
| const targetSampleSize = 20000; // minimum number of samples to get statistically sound results | ||
|
|
||
| // Calculate the right down-sampled index to query data from |
There was a problem hiding this comment.
This comment is wrong, describes not what the function does.
rockdaboot
reviewed
Mar 7, 2022
| }); | ||
| return sampleCount; | ||
| }; | ||
| return { |
There was a problem hiding this comment.
Please add an empty line before the return.
rockdaboot
reviewed
Mar 7, 2022
| }, | ||
| }, | ||
| } as IEsSearchRequest; | ||
| return es.search(downsampledReq, options, deps); |
There was a problem hiding this comment.
Please add an empty line before the return.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 is a draft
Here we introduce the usage of the data plugin.
The plugin can be handy to simplify client/server interaction but it comes with a less-widely-open API.
Instead of the REST methods we are using now, it would use an
/internal/bsearchendpoint that I still have to explore.This PR starts implementing it and has some other refactoring that were needed to work with the plugin, such as using shared types between client and server.
I'd like to get a feedback from you about the ergonomics and the possible limitations (still working on implementing the search strategy client-side, working on it atm).