How to simulate X-Opaque-Id semantics in Elasticsearch 5.3

For the benefit of future readers, I see there is another approach using stats: