Change Visualization source from Index-Pattern to Saved Search

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?

That question you referenced was from a year ago and I don't believe there is a way to make this change from the UI at this time.

There is a pretty old issue which you can track and/or show your support on: https://github.com/elastic/kibana/issues/5060

You are right, I don't know where I saw 2007... I edited my post. Thanks for the issue link.

If not from the UI, I could I do this using APIs? Is it possible to use the DevTools>Console UI from Kibana?

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.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.