# Index management

**URL:** <https://discuss.elastic.co/t/index-management/9294>\
**Category:** Elasticsearch\
**Created:** [October 9, 2012, 5:12pm UTC](https://discuss.elastic.co/t/index-management/9294 "2012-10-09T17:12:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [October 9, 2012, 5:12pm UTC](https://discuss.elastic.co/t/index-management/9294/1 "2012-10-09T17:12:02Z")

</div>

I am working on a tool to automatically maintain (update replicas, cache,  
etc...) indices based on various properties.

1. Is the only place to add custom properties for an index is via the  
settings? Works fine for me, just wondering if there was an another way.

2. What is the proper way to get all indices in the cluster? Currently I am  
executing a default ClusterHealthRequest request to the ClusterAdminClient.  
This returns all the indices with their ClusterIndexHealth, but not their  
settings. In order to get the settings, I then need to execute a  
ClusterStateRequest and dig deep into the response:  
response.state().metaData().getSettings().

Once again, I was wondering if there is another way to get all indices and  
their settings. The ideal solution for my scenario would be to search  
against index settings, which would require an index of indices, similar to  
the way rivers are stored.

Cheers,

Ivan

--

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [October 9, 2012, 7:04pm UTC](https://discuss.elastic.co/t/index-management/9294/2 "2012-10-09T19:04:16Z")

</div>

A correction for point #1. Custom settings works fine at index creation  
time, but do not work afterwards since MetaDataUpdateSettingsService  
rejects any non-dynamic settings. Is there another way to attach custom  
data to an index?

On Tue, Oct 9, 2012 at 10:12 AM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> I am working on a tool to automatically maintain (update replicas, cache,  
> etc...) indices based on various properties.
> 
> 1. Is the only place to add custom properties for an index is via the  
> settings? Works fine for me, just wondering if there was an another way.
> 
> 2. What is the proper way to get all indices in the cluster? Currently I  
> am executing a default ClusterHealthRequest request to the  
> ClusterAdminClient. This returns all the indices with their  
> ClusterIndexHealth, but not their settings. In order to get the settings, I  
> then need to execute a ClusterStateRequest and dig deep into the response:  
> response.state().metaData().getSettings().
> 
> Once again, I was wondering if there is another way to get all indices and  
> their settings. The ideal solution for my scenario would be to search  
> against index settings, which would require an index of indices, similar to  
> the way rivers are stored.
> 
> Cheers,
> 
> Ivan

--

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [October 19, 2012, 6:55pm UTC](https://discuss.elastic.co/t/index-management/9294/3 "2012-10-19T18:55:00Z")

</div>

Any thoughts about adding metadata to indices?

My current workaround is to add metadata using aliases. Hack? Yup, but it  
works. I would like a cleaner solution. Perhaps I should create my own  
metadata index.

--  
Ivan

On Tue, Oct 9, 2012 at 12:04 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> A correction for point #1. Custom settings works fine at index creation  
> time, but do not work afterwards since MetaDataUpdateSettingsService  
> rejects any non-dynamic settings. Is there another way to attach custom  
> data to an index?
> 
> On Tue, Oct 9, 2012 at 10:12 AM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> 
> > I am working on a tool to automatically maintain (update replicas, cache,  
> > etc...) indices based on various properties.
> > 
> > 1. Is the only place to add custom properties for an index is via the  
> > settings? Works fine for me, just wondering if there was an another way.
> > 
> > 2. What is the proper way to get all indices in the cluster? Currently I  
> > am executing a default ClusterHealthRequest request to the  
> > ClusterAdminClient. This returns all the indices with their  
> > ClusterIndexHealth, but not their settings. In order to get the settings, I  
> > then need to execute a ClusterStateRequest and dig deep into the response:  
> > response.state().metaData().getSettings().
> > 
> > Once again, I was wondering if there is another way to get all indices  
> > and their settings. The ideal solution for my scenario would be to search  
> > against index settings, which would require an index of indices, similar to  
> > the way rivers are stored.
> > 
> > Cheers,
> > 
> > Ivan

--

---

<div class="post-metadata">

**Author:** ![kimchy](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kimchy/32/44952_2.png) [@kimchy](https://discuss.elastic.co/u/kimchy)\
**Post date:** [October 20, 2012, 10:46pm UTC](https://discuss.elastic.co/t/index-management/9294/4 "2012-10-20T22:46:36Z")

</div>

1. There isn't a way to add custom metadata to an index (there is actually to do it on the mapping type). It makes sense, I would say, want to open an issue? One trick that you can do now is to have a _default_ mapping with meta element in it.

2. The cluster state API will get you back all the indices information with its settings.

On Oct 19, 2012, at 8:55 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:

> Any thoughts about adding metadata to indices?
> 
> My current workaround is to add metadata using aliases. Hack? Yup, but it works. I would like a cleaner solution. Perhaps I should create my own metadata index.
> 
> --  
> Ivan
> 
> On Tue, Oct 9, 2012 at 12:04 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:  
> A correction for point #1. Custom settings works fine at index creation time, but do not work afterwards since MetaDataUpdateSettingsService rejects any non-dynamic settings. Is there another way to attach custom data to an index?
> 
> On Tue, Oct 9, 2012 at 10:12 AM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:  
> I am working on a tool to automatically maintain (update replicas, cache, etc...) indices based on various properties.
> 
> 1. Is the only place to add custom properties for an index is via the settings? Works fine for me, just wondering if there was an another way.
> 
> 2. What is the proper way to get all indices in the cluster? Currently I am executing a default ClusterHealthRequest request to the ClusterAdminClient. This returns all the indices with their ClusterIndexHealth, but not their settings. In order to get the settings, I then need to execute a ClusterStateRequest and dig deep into the response: response.state().metaData().getSettings().
> 
> Once again, I was wondering if there is another way to get all indices and their settings. The ideal solution for my scenario would be to search against index settings, which would require an index of indices, similar to the way rivers are stored.
> 
> Cheers,
> 
> Ivan
> 
> --

--

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [October 30, 2012, 7:52pm UTC](https://discuss.elastic.co/t/index-management/9294/5 "2012-10-30T19:52:43Z")

</div>

Opened an issue: [Feature Request: Allow the addition of custom metadata to an index · Issue #2373 · elastic/elasticsearch · GitHub](https://github.com/elasticsearch/elasticsearch/issues/2373)

The mapping suggestion is another great idea. So far, aliases have been  
proven quite useful since I can visually inspect the most important  
property using head.

--  
Ivan

On Sat, Oct 20, 2012 at 3:46 PM, [kimchy@gmail.com](mailto:kimchy@gmail.com) wrote:

> 1. There isn't a way to add custom metadata to an index (there is actually  
> to do it on the mapping type). It makes sense, I would say, want to open an  
> issue? One trick that you can do now is to have a _default_ mapping with  
> meta element in it.
> 
> 2. The cluster state API will get you back all the indices information  
> with its settings.
> 
> On Oct 19, 2012, at 8:55 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> 
> Any thoughts about adding metadata to indices?
> 
> My current workaround is to add metadata using aliases. Hack? Yup, but it  
> works. I would like a cleaner solution. Perhaps I should create my own  
> metadata index.
> 
> --  
> Ivan
> 
> On Tue, Oct 9, 2012 at 12:04 PM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> 
> > A correction for point #1. Custom settings works fine at index creation  
> > time, but do not work afterwards since MetaDataUpdateSettingsService  
> > rejects any non-dynamic settings. Is there another way to attach custom  
> > data to an index?
> > 
> > On Tue, Oct 9, 2012 at 10:12 AM, Ivan Brusic [ivan@brusic.com](mailto:ivan@brusic.com) wrote:
> > 
> > > I am working on a tool to automatically maintain (update replicas,  
> > > cache, etc...) indices based on various properties.
> > > 
> > > 1. Is the only place to add custom properties for an index is via the  
> > > settings? Works fine for me, just wondering if there was an another way.
> > > 
> > > 2. What is the proper way to get all indices in the cluster? Currently I  
> > > am executing a default ClusterHealthRequest request to the  
> > > ClusterAdminClient. This returns all the indices with their  
> > > ClusterIndexHealth, but not their settings. In order to get the settings, I  
> > > then need to execute a ClusterStateRequest and dig deep into the response:  
> > > response.state().metaData().getSettings().
> > > 
> > > Once again, I was wondering if there is another way to get all indices  
> > > and their settings. The ideal solution for my scenario would be to search  
> > > against index settings, which would require an index of indices, similar to  
> > > the way rivers are stored.
> > > 
> > > Cheers,
> > > 
> > > Ivan
> 
> --
> 
> --

--

---

<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:** [July 6, 2017, 3:06am UTC](https://discuss.elastic.co/t/index-management/9294/6 "2017-07-06T03:06:46Z")

</div>


