# Metadata cleanup

**URL:** <https://discuss.elastic.co/t/metadata-cleanup/14453>\
**Category:** Elasticsearch\
**Created:** [November 18, 2013, 8:51pm UTC](https://discuss.elastic.co/t/metadata-cleanup/14453 "2013-11-18T20:51:18Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![the\_nozzle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/the_nozzle/32/1935_2.png) [@the\_nozzle](https://discuss.elastic.co/u/the_nozzle)\
**Post date:** [November 18, 2013, 8:51pm UTC](https://discuss.elastic.co/t/metadata-cleanup/14453/1 "2013-11-18T20:51:18Z")

</div>

Hey all - is there a way to rid the index metadata of old field entries  
that essentially point to nothing ? Thanks .

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Boaz\_Leskes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/boaz_leskes/32/723_2.png) [@Boaz\_Leskes](https://discuss.elastic.co/u/Boaz_Leskes)\
**Post date:** [November 18, 2013, 10:29pm UTC](https://discuss.elastic.co/t/metadata-cleanup/14453/2 "2013-11-18T22:29:27Z")

</div>

Hi,

Do you mean mapping fields? If so, the answer is no - there is currently no  
way to remove them. The only option open to you is to reindex the index  
without those fields.

Boaz

On Monday, November 18, 2013 9:51:18 PM UTC+1, the\_nozzle wrote:

> Hey all - is there a way to rid the index metadata of old field entries  
> that essentially point to nothing ? Thanks .

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![the\_nozzle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/the_nozzle/32/1935_2.png) [@the\_nozzle](https://discuss.elastic.co/u/the_nozzle)\
**Post date:** [November 18, 2013, 11:45pm UTC](https://discuss.elastic.co/t/metadata-cleanup/14453/3 "2013-11-18T23:45:09Z")

</div>

actually - let me clarify - I do have a mapping defined with some static  
fields which allows dynamic field additions - The issue is that I posted  
some objects with a string field , however later I decided to for that  
field to be an object . When I post I get the unknown property exception -  
That old field is still in the mapping as a string .. I was wondering if  
there is some way to clean this up , otherwise I would have to rename all  
the members of that field .. Thanks for any help.

On Monday, November 18, 2013 2:29:27 PM UTC-8, Boaz Leskes wrote:

> Hi,
> 
> Do you mean mapping fields? If so, the answer is no - there is currently  
> no way to remove them. The only option open to you is to reindex the index  
> without those fields.
> 
> Boaz
> 
> On Monday, November 18, 2013 9:51:18 PM UTC+1, the\_nozzle wrote:
> 
> > Hey all - is there a way to rid the index metadata of old field entries  
> > that essentially point to nothing ? Thanks .

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![the\_nozzle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/the_nozzle/32/1935_2.png) [@the\_nozzle](https://discuss.elastic.co/u/the_nozzle)\
**Post date:** [November 18, 2013, 11:50pm UTC](https://discuss.elastic.co/t/metadata-cleanup/14453/4 "2013-11-18T23:50:25Z")

</div>

actually - let me clarify - I do have a mapping defined with some static  
fields which allows dynamic field additions - The issue is that I posted  
some objects with a string field , however later I decided to for that  
field to be an object . When I post I get the unknown property exception -  
That old field is still in the mapping as a string .. I was wondering if  
there is some way to clean this up , otherwise I would have to rename that  
field (and a few others with the same problem.. the json serializer  
decided to output an escaped string instead of valid json).. Thanks for  
any help.

On Monday, November 18, 2013 2:29:27 PM UTC-8, Boaz Leskes wrote:

> Hi,
> 
> Do you mean mapping fields? If so, the answer is no - there is currently  
> no way to remove them. The only option open to you is to reindex the index  
> without those fields.
> 
> Boaz
> 
> On Monday, November 18, 2013 9:51:18 PM UTC+1, the\_nozzle wrote:
> 
> > Hey all - is there a way to rid the index metadata of old field entries  
> > that essentially point to nothing ? Thanks .

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Boaz\_Leskes](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/boaz_leskes/32/723_2.png) [@Boaz\_Leskes](https://discuss.elastic.co/u/Boaz_Leskes)\
**Post date:** [November 19, 2013, 8:59am UTC](https://discuss.elastic.co/t/metadata-cleanup/14453/5 "2013-11-19T08:59:04Z")

</div>

Hi,

Once a field is created you can not change it's type. The reason behind it  
that ES already has data for that field and needs to stay consisted with it.

The only option you have is deleting the index (or the type for that  
matter) and create it again, or creating a new index and copying the data  
over without the field in question.

On Tue, Nov 19, 2013 at 12:50 AM, the\_nozzle [k11stan@gmail.com](mailto:k11stan@gmail.com) wrote:

> actually - let me clarify - I do have a mapping defined with some static  
> fields which allows dynamic field additions - The issue is that I posted  
> some objects with a string field , however later I decided to for that  
> field to be an object . When I post I get the unknown property exception -  
> That old field is still in the mapping as a string .. I was wondering if  
> there is some way to clean this up , otherwise I would have to rename that  
> field (and a few others with the same problem.. the json serializer  
> decided to output an escaped string instead of valid json).. Thanks for  
> any help.
> 
> On Monday, November 18, 2013 2:29:27 PM UTC-8, Boaz Leskes wrote:
> 
> > Hi,
> > 
> > Do you mean mapping fields? If so, the answer is no - there is currently  
> > no way to remove them. The only option open to you is to reindex the index  
> > without those fields.
> > 
> > Boaz
> > 
> > On Monday, November 18, 2013 9:51:18 PM UTC+1, the\_nozzle wrote:
> > 
> > > Hey all - is there a way to rid the index metadata of old field entries  
> > > that essentially point to nothing ? Thanks .
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/h2AmetuUoGk/unsubscribe](https://groups.google.com/d/topic/elasticsearch/h2AmetuUoGk/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to  
> > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![the\_nozzle](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/the_nozzle/32/1935_2.png) [@the\_nozzle](https://discuss.elastic.co/u/the_nozzle)\
**Post date:** [November 22, 2013, 7:44am UTC](https://discuss.elastic.co/t/metadata-cleanup/14453/6 "2013-11-22T07:44:32Z")

</div>

thanks for the reply . Yah I just used different names .. I thought that  
once all data associated with the field is gone it would go away magically,  
but the index and the actual data are 2 very different things ... Thanks  
for your help.

On Tuesday, November 19, 2013 12:59:04 AM UTC-8, Boaz Leskes wrote:

> Hi,
> 
> Once a field is created you can not change it's type. The reason behind it  
> that ES already has data for that field and needs to stay consisted with it.
> 
> The only option you have is deleting the index (or the type for that  
> matter) and create it again, or creating a new index and copying the data  
> over without the field in question.
> 
> On Tue, Nov 19, 2013 at 12:50 AM, the\_nozzle \<[k11...@gmail.com](mailto:k11...@gmail.com)\<javascript:\>
> 
> > wrote:
> 
> > actually - let me clarify - I do have a mapping defined with some static  
> > fields which allows dynamic field additions - The issue is that I posted  
> > some objects with a string field , however later I decided to for that  
> > field to be an object . When I post I get the unknown property exception -  
> > That old field is still in the mapping as a string .. I was wondering if  
> > there is some way to clean this up , otherwise I would have to rename that  
> > field (and a few others with the same problem.. the json serializer  
> > decided to output an escaped string instead of valid json).. Thanks for  
> > any help.
> > 
> > On Monday, November 18, 2013 2:29:27 PM UTC-8, Boaz Leskes wrote:
> > 
> > > Hi,
> > > 
> > > Do you mean mapping fields? If so, the answer is no - there is currently  
> > > no way to remove them. The only option open to you is to reindex the index  
> > > without those fields.
> > > 
> > > Boaz
> > > 
> > > On Monday, November 18, 2013 9:51:18 PM UTC+1, the\_nozzle wrote:
> > > 
> > > > Hey all - is there a way to rid the index metadata of old field entries  
> > > > that essentially point to nothing ? Thanks .
> > > 
> > > --  
> > > You received this message because you are subscribed to a topic in the  
> > > Google Groups "elasticsearch" group.  
> > > To unsubscribe from this topic, visit  
> > > [https://groups.google.com/d/topic/elasticsearch/h2AmetuUoGk/unsubscribe](https://groups.google.com/d/topic/elasticsearch/h2AmetuUoGk/unsubscribe).  
> > > To unsubscribe from this group and all its topics, send an email to  
> > > [elasticsearc...@googlegroups.com](mailto:elasticsearc...@googlegroups.com) \<javascript:\>.  
> > > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:05am UTC](https://discuss.elastic.co/t/metadata-cleanup/14453/7 "2017-07-06T02:05:27Z")

</div>


