-
-
Save owainb/392a5c03b89f2024fb61 to your computer and use it in GitHub Desktop.
Creating an Elasticsearch mapping with geo_shape multi field
This file contains 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
# 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