Last active
September 13, 2018 13:44
-
-
Save sourcec0de/5673720 to your computer and use it in GitHub Desktop.
Elastic Search geo_point Mapping Example. Geo_Point has been mapped to venue.location.coords
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
{ | |
"settings": { | |
"number_of_shards": 1, | |
"mapper": { | |
"dynamic": false | |
} | |
}, | |
"mappings": { | |
"venue": { | |
"properties": { | |
"contact": { | |
"dynamic": "true", | |
"properties": { | |
"facebook": { | |
"type": "string" | |
}, | |
"formattedPhone": { | |
"type": "string" | |
}, | |
"phone": { | |
"type": "string" | |
}, | |
"twitter": { | |
"type": "string" | |
} | |
} | |
}, | |
"location": { | |
"properties": { | |
"address": { | |
"type": "string" | |
}, | |
"cc": { | |
"type": "string" | |
}, | |
"city": { | |
"type": "string" | |
}, | |
"coords": { | |
"type":"geo_point" | |
}, | |
"country": { | |
"type": "string" | |
}, | |
"crossStreet": { | |
"type": "string" | |
}, | |
"distance": { | |
"type": "long" | |
}, | |
"postalCode": { | |
"type": "string" | |
}, | |
"state": { | |
"type": "string" | |
} | |
} | |
}, | |
"name": { | |
"type": "string" | |
}, | |
"nix_brand_id": { | |
"type": "string" | |
} | |
} | |
} | |
} | |
} |
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
{ | |
"_id": "4b29b04ef964a5208ba224e3", | |
"name": "Taco Del Mar", | |
"contact": { | |
"formattedPhone": "(503) 390-1267", | |
"phone": "5033901267" | |
}, | |
"location": { | |
"cc": "US", | |
"country": "United States", | |
"state": "OR", | |
"city": "Keizer", | |
"postalCode": "97303", | |
"crossStreet": "in Keizer Station", | |
"address": "6379 Ulali Dr NE", | |
"coords": { | |
"lat": 45.0112511097505, | |
"lon": -122.9980246311445 | |
} | |
}, | |
"nix_brand_id": "513fbc1283aa2dc80c0000ca" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment