% This is generated by ESQL's LastTests. Do not edit it. See docs/reference/query-languages/esql/README.md for how to regenerate it.

## Description

This function calculates the latest occurrence of the search field (the first parameter), where sorting order is determined by the sort field (the second parameter). This sorting order is always ascending and null values always sort last. Both fields support null, single-valued, and multi-valued input. If the latest sort field value appears in multiple documents, this function is allowed to return any corresponding search field value.

