我是弹性搜索的新手,我正在做一个匹配所有查询,它以这种方式检索数据,但我只想在 _source 中检索数据,我该怎么做?有什么想法吗?
{
"took": 4,
"timed_out": false,
"_shards": {
"total": 5,
"successful": 5,
"failed": 0
},
"hits": {
"total": 107271,
"max_score": 1,
"hits": [
{
"_index": "sku_index",
"_type": "po",
"_id": "0",
"_score": 1,
"_source": {
"loc": "ZZZ",
"part": "PPP",
"order_qty": "16",
}
},
{
"_index": "sku_index",
"_type": "po",
"_id": "14",
"_score": 1,
"_source": {
"loc": "ZZZ",
"part": "XXX",
"order_qty": "7",
},
{
"_index": "sku_index",
"_type": "po",
"_id": "14",
"_score": 1,
"_source": {
"loc": "ZZZ",
"part": "ZZZ",
"order_qty": "7",
}
}
.......
我想这样:
[{
"loc": "ZZZ",
"part": "PPP",
"order_qty": "16",
},
{
"loc": "ZZZ",
"part": "XXX",
"order_qty": "16",
},
{
"loc": "ZZZ",
"part": "ZZZ",
"order_qty": "7",
}
]