Not clear how to upsert ElasticSearch using python elasticsearch
问题 Look here for a similar example: https://stackoverflow.com/a/33247409/1575066 from elasticsearch import Elasticsearch es = Elasticsearch("localhost:9200") es.update(index='test',doc_type='test1',id='1',body={'doc' {'username':'Tom'},'doc_as_upsert':True}) But now imagine the goal is to append to an array or to increment a previous value (without having to get the document first). If you go with official requests, this is in the documentation: POST /website/pageviews/1/_update { "script" :