How to update a document using elasticsearch-py? How to update a document using elasticsearch-py? python python

How to update a document using elasticsearch-py?


You're almost there, you just need to enclose your body inside a "doc" field. The correct way of doing a partial update with elasticsearch-py goes like this:

coll = Elasticsearch()coll.update(index='stories-test',doc_type='news',id=hit.meta.id,                body={"doc": {"stanford": 1, "parsed_sents": parsed }})