# Geo\_shape query not working in version 6

**URL:** <https://discuss.elastic.co/t/geo-shape-query-not-working-in-version-6/132204>\
**Category:** Elasticsearch\
**Created:** [May 16, 2018, 7:52pm UTC](https://discuss.elastic.co/t/geo-shape-query-not-working-in-version-6/132204 "2018-05-16T19:52:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RahulD](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@RahulD](https://discuss.elastic.co/u/RahulD)\
**Post date:** [May 16, 2018, 7:52pm UTC](https://discuss.elastic.co/t/geo-shape-query-not-working-in-version-6/132204/1 "2018-05-16T19:52:00Z")

</div>

Hi,

I have an index with the following mapping.

```
PUT test
{
  "mappings": {
    "type1": {
      "properties": {
        "geolocation": {
          "type": "geo_shape",
          "precision": "1.0m",
          "points_only": true
        },
        "name": {
          "type": "keyword",
          "store": true,
          "ignore_above": 25
        }
      }
    }
  }
}

```

The following query works fine in the version 5.5.1:

```
GET /test/_search
{
  "size": 0,
  "query": {
    "bool": {
      "must": [
        {
          "match": {
            "name": "testname"
          }
        }
      ],
      "filter": {
        "geo_shape": {
          "geolocation": {
            "shape": {
              "type": "Polygon",
              "coordinates": [
                [
                  [
                    -78,
                    39
                  ],
                  [
                    -86,
                    39
                  ],
                  [
                    -90,
                    32
                  ],
                  [
                    -78,
                    39
                  ]
                ]
              ]
            },
            "relation": "within"
          }
        }
      }
    }
  }
}

```

Running the query on version 6.2.1 returns 0 count.

Sample document in the index looks like this:

```
{
	"geolocation": {
            
		"coordinates": [
              "-86.474",
              "35.981"
        ],
        "type": "point"
    },
	"name" : "testname"
}

```

Is there any reason why the query on the version 6 cluster would return 0 but works fine on the version 5 cluster?

Any help is appreciated.

Thanks.

---

<div class="post-metadata">

**Author:** ![RahulD](https://avatars.discourse-cdn.com/v4/letter/r/da6949/32.png) [@RahulD](https://discuss.elastic.co/u/RahulD)\
**Post date:** [May 17, 2018, 12:02pm UTC](https://discuss.elastic.co/t/geo-shape-query-not-working-in-version-6/132204/2 "2018-05-17T12:02:15Z")

</div>

It appears that the same query works in version 6 when I change the coordinates inside the field to:

```
{
	"geolocation": {
            
		"coordinates": [
              -86.1234,
              35.5678
        ],
        "type": "point"
    },
	"name" : "testname"
}

```

Removing the double quotes makes the same query work, wondering why version 5 would allow the query to run with the coordinates not stored as float but as strings.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 14, 2018, 12:02pm UTC](https://discuss.elastic.co/t/geo-shape-query-not-working-in-version-6/132204/3 "2018-06-14T12:02:16Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
