Skip to content

Instantly share code, notes, and snippets.

@owainb
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save owainb/392a5c03b89f2024fb61 to your computer and use it in GitHub Desktop.
Save owainb/392a5c03b89f2024fb61 to your computer and use it in GitHub Desktop.
Creating an Elasticsearch mapping with geo_shape multi field
# Create mapping with geo_shape multi field
curl -XPOST http://localhost:9200/geoindex -d '
{
"mappings" : {
"location" : {
"dynamic" : "false",
"properties" : {
"geo_location": {
"type" : "geo_shape",
"fields" : {
"points": {"type" : "geo_point"}
}
}
}
}
}
}
'
# Retrieve the mapping. The field has not been created as a multi field
curl -XGET http://localhost:9200/geoindex/location/_mapping
# Tidy up
curl -XDELETE http://localhost:9200/geoindex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment