ElasticSearch - Get extra field in aggregation -
i trying field aggregation. below query /iacmpi/_search?_source=false
{ "query": { "match": { "document_type": "invoicedoc" } }, "aggs": { "groupbycdminvoiceid": { "terms":{ "field" : "invoice_id" }, "aggs":{ "latestversion":{ "max":{ "field":"docversion" } } } } } }
so @ level of invoice_id field aggregation, need fetch 1 more field 'name'. dont want in query part show me hits , have traverse hits , match.
is possible?
thanks, sameer
i think top hits you're looking for.
Comments
Post a Comment