我用PY-elasticsearch散裝功能如:手柄不確定的領域Elasticsearch
//loop
action = {
"_index": "venue",
"_type": "venue",
"_id": tempid,
"_source": item
}
actions.append(action)
helpers.bulk(es, actions)
在我的結果
但是我看到:
"hits": [
{
"_index": "venue",
"_type": "venue",
"_id": "52e6d42fc36b4408dbe907d1",
"_score": 4.0977435,
"_source": {
"city": "Athens",
"name": "Half Note Jazz Club",
"address": "17 Trivonianou Street",
}
},
{
"_index": "venue",
"_type": "venue",
"_id": "530391abc36b442b25e8a514",
"_score": 4.023251,
"_source": {
"city": null, <--- this
"name": "life Jazz Cafe-bar",
"address": null <---- and this
}
}
]
假設,當我 「散裝飼料」 ES我有沒有定義城市和地址,是否有辦法在ES中刪除這些字段?
或者ES會始終創建一個空值,即使這個文件沒有這個字段? 這是ES架構還是應該在我的代碼中搜索錯誤?
更新
我完全映射如下:
<type>: {
mappings: {
<index>: {
properties: {
address: {
type: "string"
},
city: {
type: "string"
},
country: {
type: "string"
},
location: {
properties: {
coordinates: {
type: "geo_point"
},
type: {
type: "string"
}
}
},
name: {
type: "string"
}
}
}
}
}
謝謝我開始這個[issue](https://github.com/elasticsearch/elasticsearch- py/issues/57)但是請重新檢查我的代碼,它應該是我自己的錯。 – Diolor