Last active
December 22, 2015 14:09
-
-
Save altfatterz/6483861 to your computer and use it in GitHub Desktop.
addGeoTypeMapping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void addGeoTypeMapping() throws IOException { | |
XContentBuilder mapping = jsonBuilder() | |
.startObject() | |
.startObject("household") | |
.startObject("properties") | |
.startObject("location") | |
.field("type", "geo_point") | |
.endObject() | |
.endObject() | |
.endObject() | |
.endObject(); | |
client.admin().indices().prepareCreate("households") | |
.addMapping("household", mapping).execute().actionGet(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment