-
Notifications
You must be signed in to change notification settings - Fork 0
Use Kibana data plugin and search strategy #27
base: fg/types-refactor
Are you sure you want to change the base?
Conversation
Signed-off-by: inge4pres <[email protected]>
Signed-off-by: inge4pres <[email protected]>
Signed-off-by: inge4pres <[email protected]>
09d07f2
to
9d3f241
Compare
@jbcrail @rockdaboot I just updated the PR as we discussed earlier. |
es.search( | ||
{ | ||
params: { | ||
index: downsampledIndex + initialExp, |
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.
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)
.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment is wrong, describes not what the function does.
}); | ||
return sampleCount; | ||
}; | ||
return { |
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.
Please add an empty line before the return.
}, | ||
}, | ||
} as IEsSearchRequest; | ||
return es.search(downsampledReq, options, deps); |
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.
Please add an empty line before the return.
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/bsearch
endpoint 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).