How to add aggregated field with _source output field

Dear All.

i having issue while adding the the aggregated fields with _source field but key is not coming.

query :-1:
`GET healthecdemo/_search
{

"aggs": {
    "resulttest": {
        "terms": {
            "field": "healthrecordkey"
            
        }
    }
},
    "query": {
    "bool": {
        "must": [
            {
                "match": {
                    "firstname": "Firstname2467"
                }
            }
        ]
    }
},"_source": "firstname,key"

}`

here key added from agg result and firstname is alredy there with this index.

Output we want -
like : Firstname2467,121

Thanks
HadoopHelp

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.