---
title: "Comment by Przemysław Witek on \"Elasticsearch Top hits aggregation with transform\" | Hashnode"
description: "Hi, Recently we&#39;ve implemented latest function for transforms which should allow you to replace pivot with latest and get rid of the scripts in your transfo"
url: "https://hashnode.com/posts/elasticsearch-top-hits-aggregation-with-transform/5fd8c7a98593851f31618315/comment/60222dcb7d860b3782e8ed96"
---

[Discussion](https://hashnode.com/posts/elasticsearch-top-hits-aggregation-with-transform/5fd8c7a98593851f31618315)

Comment [Elasticsearch Top hits aggregation with transform](https://hashnode.com/posts/elasticsearch-top-hits-aggregation-with-transform/5fd8c7a98593851f31618315)

[Przemysław Witek](https://hashnode.com/@przemekwitek)

[Feb 9, 2021](https://hashnode.com/posts/elasticsearch-top-hits-aggregation-with-transform/5fd8c7a98593851f31618315/comment/60222dcb7d860b3782e8ed96)

Hi, Recently we've implemented `latest` function for transforms which should allow you to replace `pivot` with `latest` and get rid of the scripts in your transform.

Check out the overview [here](https://www.elastic.co/guide/en/elasticsearch/reference/master/transform-overview.html#latest-transform-overview) and the API example [here](https://www.elastic.co/guide/en/elasticsearch/reference/master/ecommerce-transforms.html)

Please note that this functionality is currently `beta` but it will change soon.

[Yassine LASRI](https://hashnode.com/@ylasri)

[Feb 9, 2021](https://hashnode.com/posts/elasticsearch-top-hits-aggregation-with-transform/5fd8c7a98593851f31618315/comment/60222dcb7d860b3782e8ed96#reply-60224bdd7d860b3782e8f201)

Nice to see Elastic team is moving on and enriching supported aggregations in the tranform, Thanks for the comment, i will have a look to this and give it a try
