Phono doc says that aggregations are based on Lime syntax, which is a layer on top of elasticsearch 6 (just a subset). Principally FILTER and AGGREGATION. First (filter) is clearly documented in Palantir doc but second is less and I often refer to Elasticsearch 6 (ES6) doc for inspiration.
Now I wonder if some ES6 behaviour are accessible in Phono
Collapse function https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-request-collapse.html
Scripting and Script Field https://www.elastic.co/guide/en/elasticsearch/reference/6.8/search-request-script-fields.html
Does anyone know if these functions exist in the Phonograph API ?