How to search the records with locations all in a polygon or multiPolygon?


(akun baru) #1

I add the mappings and insert a record with 2 locations ([13, 13], [52,
52]),
and I want to search the results with it's locations all in the polygon,not
one of the locations in the polygon. would you please tell me how to search
the reslut?

curl -XPOST localhost:9200/test5 -d '{
"mappings" : {
"gistype" : {
"properties" : {
"address":{
"properties":{
"location":{"type" : "geo_point"}
}
}
}
}
}
}'

curl -XPUT 'http://localhost:9200/test5/gistype/1' -d '{
"name": "Wind & Wetter, Berlin, Germany",
"address": [
{
"name":1,
"location": [13, 13]
},
{
"name":2,
"location": [52, 52]
}
]
}'

I searched like this , but I want to search the record locations all in the
polygon. So it's wrong .

curl -XGET 'http://localhost:9200/test5/gistype/_search?pretty=true' -d '{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geo_polygon" : {
"location" : {
"points" : [
{"lat" : 0, "lon" : 0},
{"lat" : 14, "lon" : 0},
{"lat" : 14, "lon" : 14},
{"lat" : 0, "lon" : 14}
]
}
}
}
}
}
}'

COK -+)& Watch Chef 2014 Full Movie Online HD
https://fullhdmovieonline21.wordpress.com/2014/07/03/cok-watch-chef-2014-full-movie-online-hd/
[SILIT] ?$ Watch X-Men: Days of Future Past 2014 Full Movie Online Free
https://fullhdmovieonline21.wordpress.com/2014/07/03/silit-watch-x-men-days-of-future-past-2014-full-movie-online-free/
[High] #)|/ Watch The Fault in Our Stars 2014 Full Movie Online 1080P
https://fullhdmovieonline21.wordpress.com/2014/07/03/high-watch-the-fault-in-our-stars-2014-full-movie-online-1080p/
[TUAY] +(}@ Watch Edge of Tomorrow 2014 Full Movie Online HD
https://fullhdmovieonline21.wordpress.com/2014/07/03/tuay-watch-edge-of-tomorrow-2014-full-movie-online-hd/
[PRET] =][> Watch Jersey Boys 2014 Full Movie Online 1080P
https://fullhdmovieonline21.wordpress.com/2014/07/03/pret-watch-jersey-boys-2014-full-movie-online-1080p/
[TIL] /}{( Watch Maleficent 2014 Full Movie Online HD
https://fullhdmovieonline21.wordpress.com/2014/07/03/til-watch-maleficent-2014-full-movie-online-hd/
[CLEAR] &?= Watch Think Like a Man Too 2014 Full Movie Online Free
https://fullhdmovieonline21.wordpress.com/2014/07/03/clear-_-watch-think-like-a-man-too-2014-full-movie-online-free/
[COMM] (|
$ Watch How to Train Your Dragon 2 2014 Full Movie Online Free
https://fullhdmovieonline21.wordpress.com/2014/07/03/comm-_-watch-how-to-train-your-dragon-2-2014-full-movie-online-free/
Joss &<(# Watch 22 Jump Street 2014 Full Movie Online
https://fullhdmovieonline21.wordpress.com/2014/07/03/joss-watch-22-jump-street-2014-full-movie-online/
ASU @(<{ Watch Transformers: Age of Extinction 2014 Full Movie Online
https://fullhdmovieonline21.wordpress.com/2014/07/03/asu-watch-transformers-age-of-extinction-2014-full-movie-online/
ASU %/$] Watch Need for Speed 2014 Full Movie Online for Free
https://fullhdmovieonline21.wordpress.com/2014/07/03/asu-watch-need-for-speed-2014-full-movie-online-for-free/

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/a7fc5bcf-b05d-4a2f-a2b2-23972bcea485%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


(Alexander Reelsen) #2

Hey,

if you want to search shapes inside of shapes (where a point is a shape as
well), you should use the geo_shape type, not the geo_point one. Also use
the geo_shape query and filters.

--Alex

On Thu, Jul 3, 2014 at 8:36 PM, akun baru patihgajahmada01@gmail.com
wrote:

I add the mappings and insert a record with 2 locations ([13, 13], [52,
52]),
and I want to search the results with it's locations all in the
polygon,not one of the locations in the polygon. would you please tell me
how to search the reslut?

curl -XPOST localhost:9200/test5 -d '{
"mappings" : {
"gistype" : {
"properties" : {
"address":{
"properties":{
"location":{"type" : "geo_point"}
}
}
}
}
}
}'

curl -XPUT 'http://localhost:9200/test5/gistype/1' -d '{
"name": "Wind & Wetter, Berlin, Germany",
"address": [
{
"name":1,
"location": [13, 13]
},
{
"name":2,
"location": [52, 52]
}
]
}'

I searched like this , but I want to search the record locations all in
the polygon. So it's wrong .

curl -XGET 'http://localhost:9200/test5/gistype/_search?pretty=true' -d
'{
"query": {
"filtered": {
"query": {
"match_all": {}
},
"filter": {
"geo_polygon" : {
"location" : {
"points" : [
{"lat" : 0, "lon" : 0},
{"lat" : 14, "lon" : 0},
{"lat" : 14, "lon" : 14},
{"lat" : 0, "lon" : 14}
]
}
}
}
}
}
}'

COK -+)& Watch Chef 2014 Full Movie Online HD
https://fullhdmovieonline21.wordpress.com/2014/07/03/cok-watch-chef-2014-full-movie-online-hd/
[SILIT] ?$ Watch X-Men: Days of Future Past 2014 Full Movie Online Free
https://fullhdmovieonline21.wordpress.com/2014/07/03/silit-watch-x-men-days-of-future-past-2014-full-movie-online-free/
[High] #)|/ Watch The Fault in Our Stars 2014 Full Movie Online 1080P
https://fullhdmovieonline21.wordpress.com/2014/07/03/high-watch-the-fault-in-our-stars-2014-full-movie-online-1080p/
[TUAY] +(}@ Watch Edge of Tomorrow 2014 Full Movie Online HD
https://fullhdmovieonline21.wordpress.com/2014/07/03/tuay-watch-edge-of-tomorrow-2014-full-movie-online-hd/
[PRET] =][> Watch Jersey Boys 2014 Full Movie Online 1080P
https://fullhdmovieonline21.wordpress.com/2014/07/03/pret-watch-jersey-boys-2014-full-movie-online-1080p/
[TIL] /}{( Watch Maleficent 2014 Full Movie Online HD
https://fullhdmovieonline21.wordpress.com/2014/07/03/til-watch-maleficent-2014-full-movie-online-hd/
[CLEAR] &?= Watch Think Like a Man Too 2014 Full Movie Online Free
https://fullhdmovieonline21.wordpress.com/2014/07/03/clear-_-watch-think-like-a-man-too-2014-full-movie-online-free/
[COMM] (|
$ Watch How to Train Your Dragon 2 2014 Full Movie Online Free
https://fullhdmovieonline21.wordpress.com/2014/07/03/comm-_-watch-how-to-train-your-dragon-2-2014-full-movie-online-free/
Joss &<(# Watch 22 Jump Street 2014 Full Movie Online
https://fullhdmovieonline21.wordpress.com/2014/07/03/joss-watch-22-jump-street-2014-full-movie-online/
ASU @(<{ Watch Transformers: Age of Extinction 2014 Full Movie Online
https://fullhdmovieonline21.wordpress.com/2014/07/03/asu-watch-transformers-age-of-extinction-2014-full-movie-online/
ASU %/$] Watch Need for Speed 2014 Full Movie Online for Free
https://fullhdmovieonline21.wordpress.com/2014/07/03/asu-watch-need-for-speed-2014-full-movie-online-for-free/

--
You received this message because you are subscribed to the Google Groups
"elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/a7fc5bcf-b05d-4a2f-a2b2-23972bcea485%40googlegroups.com
https://groups.google.com/d/msgid/elasticsearch/a7fc5bcf-b05d-4a2f-a2b2-23972bcea485%40googlegroups.com?utm_medium=email&utm_source=footer
.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CAGCwEM-1cCbH%3D_H-xF6tEJkm0q2Mb-qAPuF3rgZar86CVUJD_w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


(system) #3