Created
June 2, 2011 16:03
-
-
Save kimchy/1004704 to your computer and use it in GitHub Desktop.
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
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 '{ | |
"user" : "kimchy", | |
"post_date" : "2009-11-15T14:12:12", | |
"message" : "trying out Elastic Search", | |
"pin": { | |
"location": { | |
"lat": 7.1383, | |
"lon": 151.5031 | |
} | |
} | |
}' | |
curl -XGET 'http://localhost:9200/twitter/tweet/_search' -d '{ | |
"query": { | |
"filtered": { | |
"query": { | |
"match_all": {} | |
}, | |
"filter": { | |
"geo_distance": { | |
"distance": "2000km", | |
"pin.location": { | |
"lat": 7, | |
"lon": 151 | |
} | |
} | |
} | |
} | |
} | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment