1. Сreat new using the following request:
PUT /test?pretty
{
"mappings": {
"tst": {
"properties": {
"nm":{
"type":"text"
},
"loc": {
"type": "geo_point"
}
}
}
}
}
2. Geting index Information using get /test
. The result is:
{
"test" : {
"aliases" : { },
"mappings" : {
"tst" : {
"properties" : {
"loc" : {
"type" : "geo_point"
},
"nm" : {
"type" : "text"
}
}
}
},
"settings" : {
"index" : {
"creation_date" : "1554110780623",
"number_of_shards" : "5",
"number_of_replicas" : "1",
"uuid" : "M8_x6t7iSKa0Xpm_lDbAcQ",
"version" : {
"created" : "6070099"
},
"provided_name" : "test"
}
}
}
}
3. Adding new document using then following request:
post /test/tst
{
"nm":"Test1",
"loc":"37,55"
}
4. And now I perform a query using a polygon that exactly contains the point 37,55:
GET /test/tst/_search
{
"query": {
"bool" : {
"must" : {
"match_all" : {}
},
"filter" : {
"geo_polygon" : {
"loc" : {
"points" : [[36,54],
[36,56],
[38,56],
[38,54],
[36,54]]
}
}
}
}
}
}
The result is:
{
"took" : 1,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : 0,
"max_score" : null,
"hits" : [ ]
}
}
What am i doing wrong?