0
我是elasticsearch的新手,我正在做一个匹配所有查询,它以这种方式检索数据,但只有我想在_source中检索数据,我该怎么做?有什么想法吗?检索没有_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",
}
}
.......
我wnat是这样的:
[{
"loc": "ZZZ",
"part": "PPP",
"order_qty": "16",
},
{
"loc": "ZZZ",
"part": "XXX",
"order_qty": "16",
},
{
"loc": "ZZZ",
"part": "ZZZ",
"order_qty": "7",
}
]
我试着用'{ “查询”:{ “_source”:{ “包括”: “OBJ1 *”[ , “OBJ 2 *。” ], “排除”: “* .DESCRIPTION” ] }, “MATCH_ALL”:{}} } '但不工作 –
并且'GET/sku_index/po/_search { “stored_fields”:[“loc”,“part”] }'不是既不可用 –
您是否替换obj1。与所需的字段名称? – Mysterion