.startObject("properties").startObject("point").field("type", "geo_point").field("lat_lon", true).field("store", "yes").endObject().endObject()
.endObject().endObject().string();
DocumentMapper defaultMapper = MapperTests.newParser().parse(mapping);
ParsedDocument doc = defaultMapper.parse("type", "1", XContentFactory.jsonBuilder()
.startObject()
.startArray("point")
.startObject().field("lat", 1.2).field("lon", 1.3).endObject()
.startObject().field("lat", 1.4).field("lon", 1.5).endObject()
.endArray()
.endObject()
.copiedBytes());
assertThat(doc.rootDoc().getFieldables("point.lat").length, equalTo(2));
assertThat(doc.rootDoc().getFieldables("point.lon").length, equalTo(2));
assertThat(doc.rootDoc().getFieldables("point.lat")[0].getBinaryValue(), equalTo(Numbers.doubleToBytes(1.2)));
assertThat(doc.rootDoc().getFieldables("point.lon")[0].getBinaryValue(), equalTo(Numbers.doubleToBytes(1.3)));
assertThat(doc.rootDoc().getFieldables("point")[0].stringValue(), equalTo("1.2,1.3"));
assertThat(doc.rootDoc().getFieldables("point.lat")[1].getBinaryValue(), equalTo(Numbers.doubleToBytes(1.4)));
assertThat(doc.rootDoc().getFieldables("point.lon")[1].getBinaryValue(), equalTo(Numbers.doubleToBytes(1.5)));
assertThat(doc.rootDoc().getFieldables("point")[1].stringValue(), equalTo("1.4,1.5"));
}