# Elastic Search - Custom Field Mapping

**URL:** <https://discuss.elastic.co/t/elastic-search-custom-field-mapping/23592>\
**Category:** Elasticsearch\
**Created:** [May 9, 2015, 2:42am UTC](https://discuss.elastic.co/t/elastic-search-custom-field-mapping/23592 "2015-05-09T02:42:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bvnagaraju](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@bvnagaraju](https://discuss.elastic.co/u/bvnagaraju)\
**Post date:** [May 9, 2015, 2:42am UTC](https://discuss.elastic.co/t/elastic-search-custom-field-mapping/23592/1 "2015-05-09T02:42:54Z")

</div>

Hi ,

Am trying to implement the custom field mapping for the fields that are  
created after index creation

My use case is that my document has some standard fields and custom fields

Standard fields are well know during index creation

Custom fields are the knows user creates after index creation

So I defined document structure as follows

Document  
{  
StandardField1,  
StandardField2,  
CustomFields(field name,field value)

}

Now am trying add field mapping for newly added field "field03" through  
this below API

but I get the error ={"error":"MapperParsingException[No handler for type  
[document] declared on field [document]]","status":400}

can some one help me or suggest a way to do this?

PUT ....../cfm01/documenttype/\_mapping

{  
"document": {  
"properties": {  
"document": {  
"name": "document",  
"type": "document",  
"customFields": {  
"field03": {  
"type": "string",  
"store": "yes"  
}  
}  
}  
}  
}  
}

## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/166e87ca-f343-477b-8654-be54b36a319b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/166e87ca-f343-477b-8654-be54b36a319b%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Andre\_Carvalho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_carvalho/32/706_2.png) [@Andre\_Carvalho](https://discuss.elastic.co/u/Andre_Carvalho)\
**Post date:** [May 9, 2015, 11:53pm UTC](https://discuss.elastic.co/t/elastic-search-custom-field-mapping/23592/2 "2015-05-09T23:53:57Z")

</div>

Hi,

Its not possible to change the mappings after the index is created. You  
will need to recreate the index and set the mappings accordingly.

# André Carvalho

+55 21 98739-1097 / [br.linkedin.com/in/andrestc/](http://br.linkedin.com/in/andrestc/)

2015-05-08 23:42 GMT-03:00 bvnrwork [budda08nitt@gmail.com](mailto:budda08nitt@gmail.com):

> Hi ,
> 
> Am trying to implement the custom field mapping for the fields that are  
> created after index creation
> 
> My use case is that my document has some standard fields and custom  
> fields
> 
> Standard fields are well know during index creation
> 
> Custom fields are the knows user creates after index creation
> 
> So I defined document structure as follows
> 
> Document  
> {  
> StandardField1,  
> StandardField2,  
> CustomFields(field name,field value)
> 
> }
> 
> Now am trying add field mapping for newly added field "field03" through  
> this below API
> 
> but I get the error ={"error":"MapperParsingException[No handler for type  
> [document] declared on field [document]]","status":400}
> 
> can some one help me or suggest a way to do this?
> 
> PUT ....../cfm01/documenttype/\_mapping
> 
> {  
> "document": {  
> "properties": {  
> "document": {  
> "name": "document",  
> "type": "document",  
> "customFields": {  
> "field03": {  
> "type": "string",  
> "store": "yes"  
> }  
> }  
> }  
> }  
> }  
> }
> 
> ## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)
> 
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/166e87ca-f343-477b-8654-be54b36a319b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/166e87ca-f343-477b-8654-be54b36a319b%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/166e87ca-f343-477b-8654-be54b36a319b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/166e87ca-f343-477b-8654-be54b36a319b%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CACigSzKbsdSQujwwu0ZesjWhzF8njQwvOV7m%3DNHXPpCN\_9BO\_w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CACigSzKbsdSQujwwu0ZesjWhzF8njQwvOV7m%3DNHXPpCN_9BO_w%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![bvnagaraju](https://avatars.discourse-cdn.com/v4/letter/b/ed655f/32.png) [@bvnagaraju](https://discuss.elastic.co/u/bvnagaraju)\
**Post date:** [May 9, 2015, 11:55pm UTC](https://discuss.elastic.co/t/elastic-search-custom-field-mapping/23592/3 "2015-05-09T23:55:23Z")

</div>

hi Carvalho,

I am trying to create a new field mapping not changing it

Regards  
Nagaraju  
908 517 6981

On Sat, May 9, 2015 at 7:53 PM, André Carvalho [asantostc@gmail.com](mailto:asantostc@gmail.com) wrote:

> Hi,
> 
> Its not possible to change the mappings after the index is created. You  
> will need to recreate the index and set the mappings accordingly.
> 
> # André Carvalho
> 
> +55 21 98739-1097 / [br.linkedin.com/in/andrestc/](http://br.linkedin.com/in/andrestc/)
> 
> 2015-05-08 23:42 GMT-03:00 bvnrwork [budda08nitt@gmail.com](mailto:budda08nitt@gmail.com):
> 
> > Hi ,
> > 
> > Am trying to implement the custom field mapping for the fields that are  
> > created after index creation
> > 
> > My use case is that my document has some standard fields and custom  
> > fields
> > 
> > Standard fields are well know during index creation
> > 
> > Custom fields are the knows user creates after index creation
> > 
> > So I defined document structure as follows
> > 
> > Document  
> > {  
> > StandardField1,  
> > StandardField2,  
> > CustomFields(field name,field value)
> > 
> > }
> > 
> > Now am trying add field mapping for newly added field "field03" through  
> > this below API
> > 
> > but I get the error ={"error":"MapperParsingException[No handler for type  
> > [document] declared on field [document]]","status":400}
> > 
> > can some one help me or suggest a way to do this?
> > 
> > PUT ....../cfm01/documenttype/\_mapping
> > 
> > {  
> > "document": {  
> > "properties": {  
> > "document": {  
> > "name": "document",  
> > "type": "document",  
> > "customFields": {  
> > "field03": {  
> > "type": "string",  
> > "store": "yes"  
> > }  
> > }  
> > }  
> > }  
> > }  
> > }
> > 
> > ## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)
> > 
> > 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).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/166e87ca-f343-477b-8654-be54b36a319b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/166e87ca-f343-477b-8654-be54b36a319b%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/166e87ca-f343-477b-8654-be54b36a319b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/166e87ca-f343-477b-8654-be54b36a319b%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .  
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> ## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)
> 
> 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/hCv4beO9-bY/unsubscribe](https://groups.google.com/d/topic/elasticsearch/hCv4beO9-bY/unsubscribe).  
> To unsubscribe from this group and all its topics, send an email to  
> [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CACigSzKbsdSQujwwu0ZesjWhzF8njQwvOV7m%3DNHXPpCN\_9BO\_w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CACigSzKbsdSQujwwu0ZesjWhzF8njQwvOV7m%3DNHXPpCN_9BO_w%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CACigSzKbsdSQujwwu0ZesjWhzF8njQwvOV7m%3DNHXPpCN\_9BO\_w%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CACigSzKbsdSQujwwu0ZesjWhzF8njQwvOV7m%3DNHXPpCN_9BO_w%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAFtuXX%2Be-%2Bwypbyi4H3QuLUegkoC9ych\_Y2JNupNwsbocpz83g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAFtuXX%2Be-%2Bwypbyi4H3QuLUegkoC9ych_Y2JNupNwsbocpz83g%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Andre\_Carvalho](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andre_carvalho/32/706_2.png) [@Andre\_Carvalho](https://discuss.elastic.co/u/Andre_Carvalho)\
**Post date:** [May 10, 2015, 12:17am UTC](https://discuss.elastic.co/t/elastic-search-custom-field-mapping/23592/4 "2015-05-10T00:17:08Z")

</div>

Hi,

Take a look here:  
[Update field mappings | Elasticsearch API documentation](http://www.elastic.co/guide/en/elasticsearch/reference/current/indices-put-mapping.html).  
The syntax you are using looks a bit odd.

# André Carvalho

+55 21 98739-1097 / [br.linkedin.com/in/andrestc/](http://br.linkedin.com/in/andrestc/)

2015-05-09 20:55 GMT-03:00 buddarapu nagaraju [budda08nitt@gmail.com](mailto:budda08nitt@gmail.com):

> hi Carvalho,
> 
> I am trying to create a new field mapping not changing it
> 
> Regards  
> Nagaraju  
> 908 517 6981
> 
> On Sat, May 9, 2015 at 7:53 PM, André Carvalho [asantostc@gmail.com](mailto:asantostc@gmail.com)  
> wrote:
> 
> > Hi,
> > 
> > Its not possible to change the mappings after the index is created. You  
> > will need to recreate the index and set the mappings accordingly.
> > 
> > # André Carvalho
> > 
> > +55 21 98739-1097 / [br.linkedin.com/in/andrestc/](http://br.linkedin.com/in/andrestc/)
> > 
> > 2015-05-08 23:42 GMT-03:00 bvnrwork [budda08nitt@gmail.com](mailto:budda08nitt@gmail.com):
> > 
> > > Hi ,
> > > 
> > > Am trying to implement the custom field mapping for the fields that are  
> > > created after index creation
> > > 
> > > My use case is that my document has some standard fields and custom  
> > > fields
> > > 
> > > Standard fields are well know during index creation
> > > 
> > > Custom fields are the knows user creates after index creation
> > > 
> > > So I defined document structure as follows
> > > 
> > > Document  
> > > {  
> > > StandardField1,  
> > > StandardField2,  
> > > CustomFields(field name,field value)
> > > 
> > > }
> > > 
> > > Now am trying add field mapping for newly added field "field03" through  
> > > this below API
> > > 
> > > but I get the error ={"error":"MapperParsingException[No handler for  
> > > type [document] declared on field [document]]","status":400}
> > > 
> > > can some one help me or suggest a way to do this?
> > > 
> > > PUT ....../cfm01/documenttype/\_mapping
> > > 
> > > {  
> > > "document": {  
> > > "properties": {  
> > > "document": {  
> > > "name": "document",  
> > > "type": "document",  
> > > "customFields": {  
> > > "field03": {  
> > > "type": "string",  
> > > "store": "yes"  
> > > }  
> > > }  
> > > }  
> > > }  
> > > }  
> > > }
> > > 
> > > ## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)
> > > 
> > > 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).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/elasticsearch/166e87ca-f343-477b-8654-be54b36a319b%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/166e87ca-f343-477b-8654-be54b36a319b%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/elasticsearch/166e87ca-f343-477b-8654-be54b36a319b%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/166e87ca-f343-477b-8654-be54b36a319b%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .  
> > > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> > 
> > ## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)
> > 
> > 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/hCv4beO9-bY/unsubscribe](https://groups.google.com/d/topic/elasticsearch/hCv4beO9-bY/unsubscribe).  
> > To unsubscribe from this group and all its topics, send an email to  
> > [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/elasticsearch/CACigSzKbsdSQujwwu0ZesjWhzF8njQwvOV7m%3DNHXPpCN\_9BO\_w%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CACigSzKbsdSQujwwu0ZesjWhzF8njQwvOV7m%3DNHXPpCN_9BO_w%40mail.gmail.com)  
> > [https://groups.google.com/d/msgid/elasticsearch/CACigSzKbsdSQujwwu0ZesjWhzF8njQwvOV7m%3DNHXPpCN\_9BO\_w%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CACigSzKbsdSQujwwu0ZesjWhzF8njQwvOV7m%3DNHXPpCN_9BO_w%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> > .
> > 
> > For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).
> 
> ## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)
> 
> 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).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/CAFtuXX%2Be-%2Bwypbyi4H3QuLUegkoC9ych\_Y2JNupNwsbocpz83g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAFtuXX%2Be-%2Bwypbyi4H3QuLUegkoC9ych_Y2JNupNwsbocpz83g%40mail.gmail.com)  
> [https://groups.google.com/d/msgid/elasticsearch/CAFtuXX%2Be-%2Bwypbyi4H3QuLUegkoC9ych\_Y2JNupNwsbocpz83g%40mail.gmail.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/CAFtuXX%2Be-%2Bwypbyi4H3QuLUegkoC9ych_Y2JNupNwsbocpz83g%40mail.gmail.com?utm_medium=email&utm_source=footer)  
> .
> 
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

## -- Please update your bookmarks! We moved to [https://discuss.elastic.co/](https://discuss.elastic.co/)

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).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CACigSz%2B\_Wp\_yGquiS8%2BkRWbmYSBAcL4oAt0qATs8odv5A5u7oQ%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CACigSz%2B_Wp_yGquiS8%2BkRWbmYSBAcL4oAt0qATs8odv5A5u7oQ%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:14am UTC](https://discuss.elastic.co/t/elastic-search-custom-field-mapping/23592/5 "2017-07-06T00:14:48Z")

</div>


