@nickoneill
Interesting... I am having the exact opposite experience using 7.3 .... I put in the WKT Regions and all the searches you provided return correct results and I can not get a bad result randomly and when I zoom down within meters it seems the results are still good until I place a point almost directly on top of the line.. that is not to say that there is not an issue.
DELETE /regions
PUT /regions
{
"mappings": {
"properties": {
"name" : {"type" : "text"},
"location": {
"type": "geo_shape"
}
}
}
}
POST /regions/_doc
{
"name": "NY",
"location": "POLYGON((-73.343806 45.013027,-73.332852 44.804903,-73.387622 44.618687,-73.294514 44.437948,-73.321898 44.246255,-73.436914 44.043608,-73.349283 43.769761,-73.404052 43.687607,-73.245221 43.523299,-73.278083 42.833204,-73.267129 42.745573,-73.508114 42.08834,-73.486206 42.050002,-73.55193 41.294184,-73.48073 41.21203,-73.727192 41.102491,-73.655992 40.987475,-73.22879 40.905321,-73.141159 40.965568,-72.774204 40.965568,-72.587988 40.998429,-72.28128 41.157261,-72.259372 41.042245,-72.100541 40.992952,-72.467496 40.845075,-73.239744 40.625997,-73.562884 40.582182,-73.776484 40.593136,-73.935316 40.543843,-74.022947 40.708151,-73.902454 40.998429,-74.236547 41.14083,-74.69661 41.359907,-74.740426 41.431108,-74.89378 41.436584,-75.074519 41.60637,-75.052611 41.754247,-75.173104 41.869263,-75.249781 41.863786,-75.35932 42.000709,-79.76278 42.000709,-79.76278 42.252649,-79.76278 42.269079,-79.149363 42.55388,-79.050778 42.690804,-78.853608 42.783912,-78.930285 42.953697,-79.012439 42.986559,-79.072686 43.260406,-78.486653 43.375421,-77.966344 43.369944,-77.75822 43.34256,-77.533665 43.233021,-77.391265 43.276836,-76.958587 43.271359,-76.695693 43.34256,-76.41637 43.523299,-76.235631 43.528776,-76.230154 43.802623,-76.137046 43.961454,-76.3616 44.070993,-76.312308 44.196962,-75.912491 44.366748,-75.764614 44.514625,-75.282643 44.848718,-74.828057 45.018503,-74.148916 44.991119,-73.343806 45.013027))"
}
POST /regions/_doc
{
"name": "CT",
"location": "POLYGON((-73.053528 42.039048,-71.799309 42.022617,-71.799309 42.006186,-71.799309 41.414677,-71.859555 41.321569,-71.947186 41.338,-72.385341 41.261322,-72.905651 41.28323,-73.130205 41.146307,-73.371191 41.102491,-73.655992 40.987475,-73.727192 41.102491,-73.48073 41.21203,-73.55193 41.294184,-73.486206 42.050002,-73.053528 42.039048))"
}
All these searches return correct results a created them as points to view as well
-73.554212, 41.053923 (stamford, CT)
-73.624998,41.047451 (greenwich, CT)
-73.708180,41.126757 (armonk, NY)
These Points work correctly as well
-73.572866,41.142307 (north stamford, CT)
-73.681591,41.098201 (greenwich, CT)
-73.683025,41.017221 (rye brook, NY)
Using this query and substituting in each in turn I got correct results for each. I also put in a number very close to the borders and they were correct.
north stamford : correct
GET /regions/_search
{
"_source": [
"name"
],
"query": {
"bool": {
"must": {
"match_all": {}
},
"filter": {
"geo_shape": {
"location": {
"shape": {
"type": "point",
"coordinates": [
-73.572866,
41.142307
]
}
}
}
}
}
}
}
results for north stamford etc
{
"took" : 4,
"timed_out" : false,
"_shards" : {
"total" : 1,
"successful" : 1,
"skipped" : 0,
"failed" : 0
},
"hits" : {
"total" : {
"value" : 1,
"relation" : "eq"
},
"max_score" : 1.0,
"hits" : [
{
"_index" : "regions",
"_type" : "_doc",
"_id" : "GFC8nWwBvL0x7al8Ij6K",
"_score" : 1.0,
"_source" : {
"name" : "CT"
}
}
]
}
}
Not sure what to tell you / think at this point. This is all on 7.3...