Search geo data by IP address

Hi,
I have an index that contains geo_point field. Is there a way to search in this field (for example filter the distance) by an IP address? For example something like this:

GET /my_locations/_search
{
  "query": {
    "bool": {
      "must": {
        "match_all": {}
      },
      "filter": {
        "geo_distance": {
          "distance": "200km",
          "pin": "8.8.8.8"
        }
      }
    }
  }
}

So that the IP address would be automatically converted to lat + lon just like during ingestion/indexing and only documents within this distance would be returned?

Thanks!

You would need to run that conversion external to Elasticsearch and then feed it into a query, there's no way to have Elasticsearch automatically translate it for you like that.

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