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

Should vistypes be able to implement custom query logic? #6345

Closed
spalger opened this issue Feb 26, 2016 · 3 comments
Closed

Should vistypes be able to implement custom query logic? #6345

spalger opened this issue Feb 26, 2016 · 3 comments
Labels
Feature:Plugins Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure

Comments

@spalger
Copy link
Contributor

spalger commented Feb 26, 2016

While attempting to implement a sample visualization for elastic/elasticsearch#16817 I found the desire to implement a query within the vistype. This would allow simply adding a custom visualization to the system and getting both support for the new correlation metric and a visualization that best represented it's output. Unfortunately doing so has proven difficult.

The approach I ended up taking was:

  1. create a filter context service that gives my vistype access to the current global filters (time and filterbar)
  2. expose the savedVis directly to the editor so that a custom controller could copy the filters and index pattern from the savedVis.searchSource to the vis.params.
  3. add the $scope.addGenericFetcher() function, which registers a simple function with the courier that will be called everytime the courier wants to fetch "searches" (the pr is still pending).
  4. read the filterContext, vis.params.index and vis.params.filters to create a query that I could then send to elasticsearch with the elasticsearch client. Unfortunately this meant writing more elasticsearch queries directly in the front-end rather than a parameterized rest endpoint, but what is a girl to do?

Hopefully we can come up with a better way to accomplish this... or decide that we don't want vistypes to try and mix the current context with their custom querying... Thoughts?

@trevan
Copy link
Contributor

trevan commented Feb 26, 2016

Couldn't this be a custom agg_type or am I missing something?

@spalger
Copy link
Contributor Author

spalger commented Feb 29, 2016

Well, I the issue linked above should be a custom agg type, yes. But my issue is that other visualizations (like timelion sheets for instance) need to define how they fetch their data. This is all done outside of the standard elasticsearch aggregation/search abstraction.

@thomasneirynck thomasneirynck added the Feature:Visualizations Generic visualization features (in case no more specific feature label is available) label Jan 23, 2017
@timroes timroes added the Team:Visualizations Visualization editors, elastic-charts and infrastructure label Sep 16, 2018
@timroes
Copy link
Contributor

timroes commented Jun 21, 2021

Closign this as not really up-to-date with our current infrastructure anymore :-)

@timroes timroes closed this as completed Jun 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature:Plugins Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:enhancement Team:Visualizations Visualization editors, elastic-charts and infrastructure
Projects
None yet
Development

No branches or pull requests

5 participants