Using query in visualize

This answer may help: Custom queries in kibana So basically you could create a query in discover, save it, then use it in a visualization. This would only allow a subset of the full Elastic DSL to be used.