XContentBuilder builder=XContentFactory.jsonBuilder()
.startObject()//注意不要加index和type
.startObject("properties")
.startObject("id1").field("type", "integer").field("store", "yes").endObject()
.startObject("kw1").field("type", "string").field("store", "yes").field("analyzer", "ik").endObject()
.startObject("edate33").field("type", "date").field("store", "yes").endObject()
.endObject()
.endObject();
client.admin().indices().prepareCreate("phone1").addMapping("jingdong", builder).get(); json