一、通过_source显示指定的字段
{
"_source": [
"showed_field1",
"showed_field12"
],
"query": { // 非必要
"query_string": {
"query": "query_content"
}
}
}
二、排除指定字段
{
"_source": {
"exclude": [ // excludes优先级>includes优先级
"exclude_field1"
]
},
"query": {
"query_string": {
"query": "query_content"
}
}
}
三、不展示索引原始字段
{
"_source": false,
"query": {
"query_string": {
"query": "query_content"
}
}
}
四、显示指定路径内容
GET /index_name/_search?filter_path=hits.hits._source,hits.total
{
"took": 2,
"hits": {
"hits": [
{
"_source": {
"id": "dwd656"
}
}
]
}
}