The current version of Elasticsearch (8.17) does not offer a solution for this complication. A workaround is to perform a msearch and handle it on the server side.
msearch