Search code examples
elasticsearchkibanapipelineelastic-stack

Is there a way to use 'Geo-polygon' query inside elasticsearch ingest pipeline?


I want to use the elasticsearch Geo-polygon query (https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-geo-polygon-query.html) or Geo-shape query inside an ingest pipeline and I've been thinking how to do it - as there is no such processor as query processor and the example for the geo polygon is with this type of query.

The reason for me trying to use this tool is to enrich documents which's country location is null, by checking their lat and lon fields and determining which country the doc is from.

Is there anyway this could be done in an ingest pipeline? Or any other way to determine a position by lat and lon within geo shapes in a pipeline?


Solution

  • Answer for enrichment of the data with geo-based policy: https://discuss.elastic.co/t/geo-polygon-query-inside-ingest-pipeline/274886/9

    Also note that there is a feature suggestion pending in Elastic Github in order to exclude the geo-shape used for the enrichment, so there will be no need for a second pipeline to delete the field.