In Nov 2019, someone asked the same question and the answer was that it was not possible. Was there any change about that?
I would like to modify an existing visualization that uses an index pattern and use a saved search instead. I looked at 2 objects, one using the index pattern and the other the saved search and I think it is safe to say that the only thing missing to be able to correctly modify it through the GUI is the savedSearchRefName attribute.
Other than that, kibanaSavedObjectMeta.searchSourceJSON and references are already modifiable.
So I think the 2020 question is: how can I add a savedSearchRefName to an existing vis?
The Dev Tools Console application is for Elasticsearch API's. We do have an API for interacting with these objects documented here. We have an issue open to add support to Console to also support Kibana API's here.
I am not sure what exactly is needed other than setting savedSearchRefName as modifying these documents directly is not something we provide support or documentation for. So, you're free to experiement but it would be a "proceed at your own risk" sort of thing.
As an aside, we are working on a new visualization called Lens currently in Beta that is much more flexible. I am not sure about changing a search source, but you can change between visualizations types.
Saved searches are mostly a set of filters that can be applied, they still operate on an index pattern underneath. Your best option is to re-create the filters from your saved search.
Lens doesn't currently support saved searches as a data source, and it's low in the list of priorities. Here is the issue
While this is true, the saved search is more flexible as you can use one common set of data between multiple related viz and if required a modification, you only have one place to change.
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.