Skip to content

Instantly share code, notes, and snippets.

Created July 19, 2011 16:42
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 anonymous/1093017 to your computer and use it in GitHub Desktop.
Save anonymous/1093017 to your computer and use it in GitHub Desktop.
curl -XPUT 'http://localhost:9200/twitter'
curl -XPUT 'http://localhost:9200/twitter/tweet/_mapping' -d '{
"tweet" : {
"properties" : {
"pin": {
"properties": {
"location": {
"type": "geo_point"
}
}
}
}
}
}'
curl -XPUT 'http://localhost:9200/twitter/tweet/1' -d '{
"message" : "Locations",
"pin": {
"location": [[60,20],[50,20]]
}
}'
curl -XGET 'http://localhost:9200/twitter/tweet/_search' -d '{
"sort" : [
{
"_geo_distance" : {
"pin.location" : [60, 20],
"order" : "asc",
"unit" : "km"
}
}
],
"query": {"match_all": {}}
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment