How to filter specific field from elastic search

Is it possible to filter only specific field not full documents from elastic search.

sample data.

{
"took": 65,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"skipped": 0,
"failed": 0
},
"hits": {
"total": 1,
"max_score": 4.89784,
"hits": [
{
"_index": "mytest",
"_type": "bank",
"_id": "1",
"_score": 4.89784,
"_source": {
"account_number": 1,
"balance": 39225,
"firstname": "Amber",
"lastname": "Duke",
"age": 32,
"gender": "M",
"address": "880 Holmes Lane",
"employer": "Pyrami",
"email": "amberduke@pyrami.com",
"city": "Brogan",
"state": "IL"
}
}
]
}
expected data.

{
[
{
"account_number": 1,
"balance": 39225,
}
]
}

You should be able to achieve this through source filtering.

Thanks Christian_Dahlqvist, i will check..

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