Created
May 30, 2011 02:55
-
-
Save sbeckeriv/998396 to your computer and use it in GitHub Desktop.
ES
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
"person" => { | |
"date_formats" => ["yyyy-MM-dd", "dd-MM-yyyy"], | |
"_all" => {"enabled" => true}, | |
"properties" => { | |
"_id" => {"index"=> "not_analyzed", "store" => "yes",:type=>'integer'}, | |
"username" => {"type" => "string", "store" => "yes"}, | |
"name" => {"type" => "string", "store" => "yes"}, | |
"location" => { | |
"type" => "geo_point" | |
}, | |
"email" => {"type" => "string"}, | |
"company" => {"type" => "string"}, | |
"followers" => {"type" => "integer"}, | |
"following" => {"type" => "integer"}, | |
"started_at"=>{"type" => "date"}, | |
"repos" => { | |
"properties" => { | |
"_id" => {"index"=> "not_analyzed", "store" => "yes",:type=>'integer'}, | |
"name" => {"type" => "string"}, | |
"language" => {"type" => "string"} | |
} | |
} | |
} | |
} | |
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
#fine all people near seattle | |
{ | |
"query": { | |
"filtered": { | |
"filter": { | |
"geo_distance": { | |
"distance": "12km", | |
"location": { | |
"lat": 47.6062095, | |
"lon": -122.3320708 | |
} | |
} | |
}, | |
"query": { | |
"query_string": { | |
"query": "name:*" | |
} | |
} | |
} | |
} | |
} | |
#results | |
{"took":192,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}} | |
I know i have people near the lat,lon |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment