You can use the source filtering of elasticsearch, but for that first you need to have _source
enabled in your mapping.
You need to have below key-value in your search query JSON. below search will exclude all other fields apart from name
.
{
"query": {
"match": {
"name": "abc"
}
},
"_source": [
"name"
],
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…