Geo Context with Completion Suggester

New to Es. So apologies if I am missing something simple. I am working on a suggester which should return business names. I'd like to use a geocontext to return names that fall within a given distance ("30mi") from a user's location. From reading the docs, my understanding is that I enter the search range ("30mi") as the precision for the context I provide with the suggest. When I enter precision as a string based distance, I receive an empty or incomplete result set that misses results within the 30 mile radius. When I entered as a an integer, it works as expected. Any suggestions on what I am doing wrong? Should I be entering the 30 mile distance under neighbours? The docs weren't completely clear on difference between neighbours and precision in filtering results.

Mapping

PUT /provider/
{
    "mappings" : {
      "properties" : {
        "name_suggest": {
          "type": "completion",
          "contexts": [
            {
              "name": "location",
              "type": "geo",
              "path": "address_coordinates"
            }
          ]
        },
        "address_coordinates" : {
          "type": "geo_point"
        },
        "name" : {
          "type" : "text",
          "fields" : {
            "keyword" : {
              "type" : "keyword",
              "ignore_above" : 256
            }
          }
        },
      }
    }
}
/>

Search

<
POST provider/_search
{
  "suggest" : {
    "suggestions" : {
      "prefix" : "allergy",
      "completion" : {
        "field" : "name_suggest",
        "fuzzy": {
          "fuzziness": "AUTO"
        },
        "size": 10,
        "contexts": {
          "location": {
            "lat":35.1239,
            "lon": -80.8648,
            "precision": "30mi"
          }
        }
      }
    }
  }
}
/>

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