My index mapping is
{
"events" : {
"mappings" : {
"properties" : {
"accepted" : {
"type" : "nested"
},
"address" : {
"type" : "text"
},
"available_for" : {
"properties" : {
"key" : {
"type" : "long"
},
"value" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
"avatar_image" : {
"type" : "text"
},
"background_image" : {
"type" : "text"
},
"budget" : {
"properties" : {
"amount" : {
"type" : "long"
},
"currency" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
"creator" : {
"properties" : {
"age" : {
"type" : "long"
},
"avatar" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"id" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"name" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
},
"sex" : {
"type" : "long"
},
"vip" : {
"type" : "long"
}
}
},
"description" : {
"type" : "text"
},
"event_date" : {
"type" : "integer"
},
"invited" : {
"type" : "nested"
},
"is_checking" : {
"type" : "integer"
},
"location" : {
"type" : "geo_point"
},
"max_bid" : {
"type" : "integer"
},
"min_bid" : {
"type" : "integer"
},
"people_amount" : {
"properties" : {
"key" : {
"type" : "long"
},
"value" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
},
"status" : {
"type" : "integer"
},
"titles" : {
"type" : "object"
},
"who_pay" : {
"properties" : {
"key" : {
"type" : "long"
},
"value" : {
"type" : "text",
"fields" : {
"keyword" : {
"type" : "keyword",
"ignore_above" : 256
}
}
}
}
}
}
}
}
}
I created 3 documents in index with location of distance more then 500 meters from my position
There is polygon on my query below with radius 100 meters around my position
GET /events/_search
{
"query": {
"bool" : {
"must" : {
"match_all" : {}
},
"filter" : {
"geo_polygon" : {
"location": {
"points" : [
{
"lat": 56.010451,
"lon": 92.814699
},
{
"lat": 56.010331,
"lon": 92.815503
},
{
"lat": 56.010002,
"lon": 92.816092
},
{
"lat": 56.009552,
"lon": 92.816307
},
{
"lat": 56.009102,
"lon": 92.816092
},
{
"lat": 56.008773,
"lon": 92.815503
},
{
"lat": 56.008653,
"lon": 92.814699
},
{
"lat": 56.008773,
"lon": 92.813895
},
{
"lat": 56.009102,
"lon": 92.813306
},
{
"lat": 56.009552,
"lon": 92.813091
},
{
"lat": 56.010002,
"lon": 92.813306
},
{
"lat": 56.010331,
"lon": 92.813895
}
]
}
}
}
}
}
}
But I got the result with all the documents, despite the fact that points do not placed inside of radius of search.
Elasticesearch-7.5