I have an ElasticSearch query that returns stats about items in a single geo_polygon (number of matches, averages/totals etc.)
Is it possible to modify the query to send a list of polygons, with the results aggregated by geo_polygon?
I have an ElasticSearch query that returns stats about items in a single geo_polygon (number of matches, averages/totals etc.)
Is it possible to modify the query to send a list of polygons, with the results aggregated by geo_polygon?
you could use the filters aggregation and specify a geo filter for each of your polygons. Then you could have your statistics (I am assuming you are using aggregations to generate them) as sub-aggregations of this filters aggregation.
See the following for more information on the filters aggregation: https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filters-aggregation.html
© 2020. All Rights Reserved - Elasticsearch
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant logo are trademarks of the Apache Software Foundation in the United States and/or other countries.