# Upgrade 5.2 \> 6.x

**URL:** <https://discuss.elastic.co/t/upgrade-5-2-6-x/112653>\
**Category:** Elasticsearch\
**Created:** [December 20, 2017, 2:17pm UTC](https://discuss.elastic.co/t/upgrade-5-2-6-x/112653 "2017-12-20T14:17:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Olfax](https://avatars.discourse-cdn.com/v4/letter/o/47e85d/32.png) [@Olfax](https://discuss.elastic.co/u/Olfax)\
**Post date:** [December 20, 2017, 2:17pm UTC](https://discuss.elastic.co/t/upgrade-5-2-6-x/112653/1 "2017-12-20T14:17:57Z")

</div>

Hi,

When I try to update my project in ELS 1.6. I am encountering a problem :

IllegalArgumentException("mapping source must be pairs of fieldnames and properties definition.");

I try something easy as describe on [https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-admin-indices.html#java-admin-indices-create-index](https://www.elastic.co/guide/en/elasticsearch/client/java-api/current/java-admin-indices.html#java-admin-indices-create-index)

```
   public void createIndexBasic() {
         TransportClient transportClient = getClient();
         AdminClient adminClient = transportClient.admin();
         IndicesAdminClient indicesAdminClient = adminClient.indices();
         
         
         try {
                logger.info("deleteIndex");
                DeleteIndexResponse deleteIndexResponse = deleteDataByIndex("twitter");
                logger.info("delete Index before mapping " + deleteIndexResponse.toString());
         } catch (IndexNotFoundException e) {
                logger.error("Index non trouve");
         }            
         
         
         String mapping = "{\n" +                
            " \"tweet\": {\n" +
            " \"properties\": {\n" +
            " \"message\": {\n" +
            " \"type\": \"text\"\n" +
            " }\n" +
            " }\n" +
            " }\n" +
            " }";
         
         
         indicesAdminClient.prepareCreate("twitter")
         .addMapping("tweet", mapping )
           .get();      
         
   }

```

It seems mapping content has change. In V5, we could use json data :

/\*\*  
\* A specialized simplified mapping source method, takes the form of simple properties definition:  
\* ("field1", "type=string,store=true").  
\*/  
public CreateIndexRequestBuilder addMapping(String type, String source) {  
request.mapping(type, source);  
return this;  
}

But now :

/\*\*  
\* A specialized simplified mapping source method, takes the form of simple properties definition:  
\* ("field1", "type=string,store=true").  
\*/  
public CreateIndexRequest mapping(String type, Object... source) {  
mapping(type, \*\*tMappingRequest.buildFromSimplifiedDef(type, source));  
return this;  
}

What's the way to put a json mapping to .mapping() function ?

Best regards

Philippe

---

<div class="post-metadata">

**Author:** ![zqc0512](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/zqc0512/32/32141_2.png) [@zqc0512](https://discuss.elastic.co/u/zqc0512)\
**Post date:** [December 21, 2017, 1:02am UTC](https://discuss.elastic.co/t/upgrade-5-2-6-x/112653/2 "2017-12-21T01:02:01Z")

</div>

as i know , 1 step update to 5.6.x 2 step update to 6.x

---

<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:** [January 18, 2018, 1:02am UTC](https://discuss.elastic.co/t/upgrade-5-2-6-x/112653/3 "2018-01-18T01:02:28Z")

</div>

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