from elasticsearch import Elasticsearch
es= Elasticsearch()
index = 'test'
doc_type = 'trends'
q = {
"query": {
"match": {
"Device": "12 Bel"
# find the docs those schould be deleted
}
},
}
result = es.delete_by_query(body=q, doc_type=doc_type, index=index)
print('Result is : ', result)
私はこのエラーを取得:
AttributeError: 'Elasticsearch' object has no attribute 'delete_by_query'
誰かがこの問題を経験していますか?どんな助け? ありがとう
使用しているPython 3.Xのバージョンは何ですか?私は同じコードを使用してPython 3.5.2を実行し、関数を見つけました。 – KeirDavis
@KeirDavis:Pythonを使ったIam 2.7.9 python -V Python 2.7.9 – AhmyOhlin