# Mapper Parsing Exception while creating index

**URL:** <https://discuss.elastic.co/t/mapper-parsing-exception-while-creating-index/82548>\
**Category:** Elasticsearch\
**Created:** [April 17, 2017, 8:31am UTC](https://discuss.elastic.co/t/mapper-parsing-exception-while-creating-index/82548 "2017-04-17T08:31:39Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![tfasun](https://avatars.discourse-cdn.com/v4/letter/t/f475e1/32.png) [@tfasun](https://discuss.elastic.co/u/tfasun)\
**Post date:** [April 17, 2017, 8:31am UTC](https://discuss.elastic.co/t/mapper-parsing-exception-while-creating-index/82548/1 "2017-04-17T08:31:39Z")

</div>

I create index with

client.admin().indices().preparePutMapping(indexName)  
.setType(documentType)  
.setSource(builder)  
.get();

builder.startObject(SearchDocumentFieldName.TIMESTAMP.getFieldName())  
.field("type" "long")  
.field("index","not\_analyzed")  
.endObject()  
.startArray("arrays")  
.startObject()  
.field("type"), "string")  
.field("index", "not\_analyzed")  
.endObject()  
.endArray();

output:  
{  
"documentname" : {  
"dynamic" : "strict",  
"\_all" : {  
"enabled" : false  
},  
"properties" : {  
"timestamp" : {  
"type" : "long",  
"index" : "not\_analyzed"  
},  
"arrays" : [ {  
"type" : "string",  
"index" : "not\_analyzed"  
} ]  
}  
}

ERRORr:MapperParsingException[Expected map for property [fields] on field [arrays] but got a class java.lang.String  
]

---

<div class="post-metadata">

**Author:** ![jkuang](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jkuang/32/72637_2.png) [@jkuang](https://discuss.elastic.co/u/jkuang)\
**Post date:** [April 18, 2017, 10:53pm UTC](https://discuss.elastic.co/t/mapper-parsing-exception-while-creating-index/82548/2 "2017-04-18T22:53:04Z")

</div>

Please take a look at the datatype assignment doc below:

[https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/mapping-types.html)

Arrays do not require type assignment.

---

<div class="post-metadata">

**Author:** ![tfasun](https://avatars.discourse-cdn.com/v4/letter/t/f475e1/32.png) [@tfasun](https://discuss.elastic.co/u/tfasun)\
**Post date:** [April 19, 2017, 6:25am UTC](https://discuss.elastic.co/t/mapper-parsing-exception-while-creating-index/82548/3 "2017-04-19T06:25:30Z")

</div>

Thanks Jimmy.I solved my problem with nested object

---

<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:** [May 17, 2017, 6:25am UTC](https://discuss.elastic.co/t/mapper-parsing-exception-while-creating-index/82548/4 "2017-05-17T06:25:58Z")

</div>

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