# Top\_metric for Geo\_Point

**URL:** <https://discuss.elastic.co/t/top-metric-for-geo-point/310164>\
**Category:** Elasticsearch\
**Created:** [July 20, 2022, 2:15pm UTC](https://discuss.elastic.co/t/top-metric-for-geo-point/310164 "2022-07-20T14:15:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bianca6](https://avatars.discourse-cdn.com/v4/letter/b/85e7bf/32.png) [@bianca6](https://discuss.elastic.co/u/bianca6)\
**Post date:** [July 20, 2022, 2:15pm UTC](https://discuss.elastic.co/t/top-metric-for-geo-point/310164/1 "2022-07-20T14:15:50Z")

</div>

Hi,

In the Transform examples we can find the `top_metrics` aggregation. Here is an example:

```auto
POST _transform/_preview
{
  "source": {
    "index": "kibana_sample_data_ecommerce"
  },
  "pivot": {
    "group_by": { 
      "customer_id": {
        "terms": {
          "field": "customer_id"
        }
      }
    },
    "aggregations": {
      "last": {
        "top_metrics": { 
          "metrics": [
            {
              "field": "email"
            },
            {
              "field": "customer_first_name.keyword"
            },
            {
              "field": "customer_last_name.keyword"
            }
          ],
          "sort": {
            "order_date": "desc"
          }
        }
      }
    }
  }
}

```

I would like the exact same thing, but instead of the `email` a `geo_point` field.

But, I get the following error:

```auto
"Field [location] of type [geo_point] is not supported for aggregation [top_metrics]"

```

Why it does not work with a geo\_point? And is there another aggregation doing the same for geo\_point?

In a Transform, is there a way to get that geo\_point without a heavy `scripted_metric` who will get the information in the source? There is nothing to aggregate or compute, just to take it as it is...

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 17, 2022, 2:16pm UTC](https://discuss.elastic.co/t/top-metric-for-geo-point/310164/2 "2022-08-17T14:16:26Z")

</div>

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