I am using this code in python for updating my docs in elasticsearch. It's working fine but it's difficult to use it for a millions docs because I have to initialise the id
value everytime to update every document.
from elasticsearch import Elasticsearch, exceptions
elasticsearch = Elasticsearch()
elasticsearch.update(index='testindex', doc_type='AAA', id='AVpwMmhnpIpyZkmdMQkT',
body={
'doc':{'Device': 'updated'}
}
)
I read in the Elasticsearch documentation that it's not yet included but: https://www.elastic.co/guide/en/elasticsearch/reference/current/_updating_documents.html
Note that as of this writing, updates can only be performed on a single document at a time. In the future, Elasticsearch might provide the ability to update multiple documents given a query condition (like an SQL UPDATE-WHERE statement).