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

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -