# What Can't I Use "10m" precisions in context queries?

**URL:** <https://discuss.elastic.co/t/what-cant-i-use-10m-precisions-in-context-queries/115389>\
**Category:** Elasticsearch\
**Created:** [January 13, 2018, 1:07am UTC](https://discuss.elastic.co/t/what-cant-i-use-10m-precisions-in-context-queries/115389 "2018-01-13T01:07:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![wgottschalk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wgottschalk/32/26457_2.png) [@wgottschalk](https://discuss.elastic.co/u/wgottschalk)\
**Post date:** [January 13, 2018, 1:07am UTC](https://discuss.elastic.co/t/what-cant-i-use-10m-precisions-in-context-queries/115389/1 "2018-01-13T01:07:35Z")

</div>

I'm running on Elasticsearch 5.5  
I have a document with the following mapping

```
"mappings": {
  "shops": {
    "properties": {
      "locations": {
        "type": "geo_point"
      },
      "name": {
        "type": "keyword"
      },
      "suggest": {
        "type": "completion",
        "contexts": [
          {
            "name": "location",
            "type": "GEO",
            "precision": "10m",
            "path": "locations"
          }
        ]
      }
    }
  }

```

I'll add a document as follows:

```
PUT my_index/shops
{  
  "name":"random shop",
  "suggest":{  
    "input":"random shop"
  },
  "locations":[  
    {  
      "lat":42.38471212,
      "lon":-71.12612357
    }
  ]
}

```

I try to query for the document with the follow JSON call

```
GET my_shops/_search
{
  "suggest": {
    "result": {
      "prefix": "random",
      "completion": {
        "field": "suggest",
        "size": 5,
        "fuzzy": true,
        "contexts": {
         "location": [{
            "lat": 42.38471212,
            "lon": -71.12612357,
            "precision": "10mi"
          }]
        }
     }
    }
  }
}

```

I get the following errors:

![image](https://us1.discourse-cdn.com/elastic/original/3X/0/a/0a5bc3405aea0ec3dda389f3c8ce52ffa7c257b9.png)

But when I change the "precision" field to an int, I get the intended search results.  
I'm confused on two fronts.

1. Why is there a context error? The documentation seems to say that this is ok  
[https://www.elastic.co/guide/en/elasticsearch/reference/5.5/suggester-context.html](https://www.elastic.co/guide/en/elasticsearch/reference/5.5/suggester-context.html)

2. Why can't I use string values for the precision values?  
At the bottom of the page, I see that the precision values can take either distances or numeric values.

---

<div class="post-metadata">

**Author:** ![wgottschalk](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wgottschalk/32/26457_2.png) [@wgottschalk](https://discuss.elastic.co/u/wgottschalk)\
**Post date:** [January 16, 2018, 5:32pm UTC](https://discuss.elastic.co/t/what-cant-i-use-10m-precisions-in-context-queries/115389/2 "2018-01-16T17:32:14Z")

</div>

Is this a known bug? I can't seem to find it on github issues.

---

<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:** [February 13, 2018, 5:32pm UTC](https://discuss.elastic.co/t/what-cant-i-use-10m-precisions-in-context-queries/115389/3 "2018-02-13T17:32:40Z")

</div>

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