---
title: "Discussion on \"Elasticsearch Top hits aggregation with transform\" | Hashnode"
description: "Discussion on \"Elasticsearch Top hits aggregation with transform\". Suppose you build an application to manage an entity (like Customer, Tickets, ... etc) and you are logging any change on entity into elasticsearch index.\nExample of Case Management application that log any change on Ticket into elasticsearch monthly ..."
url: "https://hashnode.com/posts/elasticsearch-top-hits-aggregation-with-transform/5fd8c7a98593851f31618315"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Elasticsearch Top hits aggregation with transform](https://synapticiel.hashnode.dev/elasticsearch-top-hits-aggregation-with-transform?utm_source=hashnode&utm_medium=feed)

Suppose you build an application to manage an entity (like Customer, Tickets, ... etc) and you are logging any change on entity into elasticsearch index. Example of Case Management application that log any change on Ticket into elasticsearch monthly ...

Dec 1, 2020 · 10 min read · synapticiel.hashnode.dev  
Read the article

-   [#elasticsearch](https://hashnode.com/tag/elasticsearch)
-   [#kibana](https://hashnode.com/tag/kibana)
-   [#big-data](https://hashnode.com/tag/big-data)
-   [#analytics](https://hashnode.com/tag/analytics)

## Written by

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

@ylasri · Rabat, Morocco

  
[View profile](https://hashnode.com/@ylasri)

synaptique.com

Product Manager at Synapticiel, IT &amp; Telecoms Professional, Interested in ML, AI, IoT, BigData, Cyber Security, RA, FMS, Next Generation BSS/OSS, Mobile Money

## Responses 1

Markdown supported · ⌘↵ to post

[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
