# Getting saved searches (objects) for plugin use

**URL:** <https://discuss.elastic.co/t/getting-saved-searches-objects-for-plugin-use/104098>\
**Category:** Kibana\
**Created:** [October 16, 2017, 2:00pm UTC](https://discuss.elastic.co/t/getting-saved-searches-objects-for-plugin-use/104098 "2017-10-16T14:00:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Usama\_Ahmad](https://avatars.discourse-cdn.com/v4/letter/u/a698b9/32.png) [@Usama\_Ahmad](https://discuss.elastic.co/u/Usama_Ahmad)\
**Post date:** [October 16, 2017, 2:00pm UTC](https://discuss.elastic.co/t/getting-saved-searches-objects-for-plugin-use/104098/1 "2017-10-16T14:00:13Z")

</div>

Hi, I'm new to kibana and i'm trying to experiment with its plugins.

I want to get the saved searches (Objects) to use in my plugin. e.g. If i saved a search named "nameSearch" with the search content as "nabeel\*" . I would like to get this "nameSearch" and the search pattern "nabeel\*" in my plugin.

How can I achieve this? Any guidance in this regard is appreciated.

---

<div class="post-metadata">

**Author:** ![ppisljar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppisljar/32/11588_2.png) [@ppisljar](https://discuss.elastic.co/u/ppisljar)\
**Post date:** [October 17, 2017, 7:19am UTC](https://discuss.elastic.co/t/getting-saved-searches-objects-for-plugin-use/104098/2 "2017-10-17T07:19:16Z")

</div>

SavedObjectRegistry would be one way to do that ... for example to get all saved visualizations:

```auto
import { SavedObjectRegistryProvider } from 'ui/saved_objects/saved_object_registry';
 
app.controller('TestVisApp', function ($scope, Private, AppState) {
  const services = Private(SavedObjectRegistryProvider).byLoaderPropertiesName;
  const visualizationService = services.visualizations;
 
  visualizationService.find().then(result => { $scope.savedVisualizations = result.hits; });
});

```

---

<div class="post-metadata">

**Author:** ![Usama\_Ahmad](https://avatars.discourse-cdn.com/v4/letter/u/a698b9/32.png) [@Usama\_Ahmad](https://discuss.elastic.co/u/Usama_Ahmad)\
**Post date:** [October 17, 2017, 9:35am UTC](https://discuss.elastic.co/t/getting-saved-searches-objects-for-plugin-use/104098/3 "2017-10-17T09:35:30Z")

</div>

Thanks, @ppisljar for your reply.  
Actually I need to get all the saved Searches not visualizations. Can u point me in the right direction or documnetation where i can find the properties of searches instead of visualizations?

---

<div class="post-metadata">

**Author:** ![ppisljar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ppisljar/32/11588_2.png) [@ppisljar](https://discuss.elastic.co/u/ppisljar)\
**Post date:** [October 17, 2017, 11:58am UTC](https://discuss.elastic.co/t/getting-saved-searches-objects-for-plugin-use/104098/4 "2017-10-17T11:58:44Z")

</div>

unfortunately there is no documentation around this and the only way to approach it would be to start reading the code, inspecting the variables and figuring out what to do. Probably it would be best to check how this is implemented in management for example, where all the saved objects are listed.

take a look at the following file: [https://github.com/elastic/kibana/blob/master/src/ui/public/saved\_objects/find\_object\_by\_title.js](https://github.com/elastic/kibana/blob/master/src/ui/public/saved_objects/find_object_by_title.js)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 14, 2017, 11:59am UTC](https://discuss.elastic.co/t/getting-saved-searches-objects-for-plugin-use/104098/5 "2017-11-14T11:59:07Z")

</div>

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