Search geo data by IP address

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": ""

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?


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.