I honestly think the given answer is weak. There is no reason a valid query could not, and should not be saved into the index. It is perfectly reasonable for someone to build an application outside of kibana but want to leverage the search creating functionality of kibana. Off the top of my head, any application that needs to do heavy ML processing of NNs across GPUs would be hard pressed to do it with node via the kibana dashboard. Python and TensorFlow are much more suited. It is also reasonable to think the user would want to automate it by some method of retreving the RESULTS of the "saved searches. Whether that is by getting a valid Elasticsearch query or through a REST endpoint that returns results.
Its impossible currently, because we have to "trust" the APIs for how the query is saved in kibana, won't change for new ways of displaying the data in kibana. Seems to me kibana should be saving the raw query into elasticsearch, or at the very least, expose an endpoint that returns it when requested.
Here is another thread requesting the same feature: this one's response didn't even attempt to help the user, at least the one in the last reply explained how to do it with the current kibana implementation. How to execute save search from REST API in elasticsearch
The PR you mentioned above (https://github.com/elastic/kibana/pull/11632) will expose an API to manage saved objects, as opposed to saved searches. Saved Searches are one type of saved object, and if I understand the PR correctly, it is not designed to be able to execute the queries within the saved search.
Based on your research, this sounds like a feature that several people are interested in having. As this isn't currently supported, I'd suggest creating a feature request to get this added.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.