这是示例文档。
{
"_index": "mqtt-index-2018.01.23",
"_type": "iot_data",
"_id": "AWEjA7LNRU4cTUO-Lyj4",
"_score": null,
"_source": {
"message": "{\"datastream_name\": \"roshni\", \"value\": 12,
\"context\": {\"latitude\": 0, \"elevation\": 0, \"longitude\": 0},
\"device_id\": 31}",
"@version": "1",
"@timestamp": "2018-01-23T12:34:59.687Z",
"host": "iot-elk",
"topic": "telemetry/f2a55827ef554475a41c3c96369957f0/roshni",
"datastream_name": "roshni",
"value": 12,
"context": {
"latitude": 0,
"elevation": 0,
"longitude": 0
},
"device_id": 31,
"tstamp": "2018-01-23T12:34:59.687Z"
},
"fields": {
"tstamp": [
1516710899687
],
"@timestamp": [
1516710899687
]
},
"sort": [
1516710899687
]
}
我想使用 device_id 字段删除文档。如何使用 API 调用或使用 python 客户端删除它?我已经尝试使用 Document _id 和特定索引,但我想通过使用 device_id 字段或其他字段来删除它。