# How to avoid MapperParsingException?

**URL:** <https://discuss.elastic.co/t/how-to-avoid-mapperparsingexception/22276>\
**Category:** Elasticsearch\
**Created:** [February 19, 2015, 9:58pm UTC](https://discuss.elastic.co/t/how-to-avoid-mapperparsingexception/22276 "2015-02-19T21:58:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastian\_2](https://avatars.discourse-cdn.com/v4/letter/s/e0b2c6/32.png) [@sebastian\_2](https://discuss.elastic.co/u/sebastian_2)\
**Post date:** [February 19, 2015, 9:58pm UTC](https://discuss.elastic.co/t/how-to-avoid-mapperparsingexception/22276/1 "2015-02-19T21:58:49Z")

</div>

Hi,

I'm indexing documents with the following structure:

{ "name": "peter", "email": "p@p.com", "location": "MIA" }  
{ "name": "mary", "email": "m@m.com", "device": "ipad" }  
{ "name": "mary", "email": "m@m.com", "metadata": { ... } }

As you can see, I only know the type for "name" and "email" fields. The  
location, device, metadata or whatever other field are dynamic fields.

So, in order to avoid a MapperParsingException, I want to persist all of  
the document fields, but ONLY mark as "searchable" the "name" and "email"  
fields.

Can I do that using mappings?

--  
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/8bbe52be-59b4-4e78-8866-13716b3f862c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/8bbe52be-59b4-4e78-8866-13716b3f862c%40googlegroups.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:31am UTC](https://discuss.elastic.co/t/how-to-avoid-mapperparsingexception/22276/2 "2017-07-06T00:31:25Z")

</div>

Closed on July 6, 2017, 12:31am UTC


