{"action":"created","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/250","labels_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/250/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/250/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/250/events","html_url":"https://github.com/elastic/elasticsearch-dsl-py/issues/250","id":104754520,"number":250,"title":"Upsert in `update`","user":{"login":"twall","id":756909,"avatar_url":"https://avatars.githubusercontent.com/u/756909?v=3","gravatar_id":"","url":"https://api.github.com/users/twall","html_url":"https://github.com/twall","followers_url":"https://api.github.com/users/twall/followers","following_url":"https://api.github.com/users/twall/following{/other_user}","gists_url":"https://api.github.com/users/twall/gists{/gist_id}","starred_url":"https://api.github.com/users/twall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/twall/subscriptions","organizations_url":"https://api.github.com/users/twall/orgs","repos_url":"https://api.github.com/users/twall/repos","events_url":"https://api.github.com/users/twall/events{/privacy}","received_events_url":"https://api.github.com/users/twall/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-03T18:25:43Z","updated_at":"2015-09-04T12:33:32Z","closed_at":null,"body":"Would it make sense to tweak `DocType.update()` to perform an upsert if the item doesn't already exist (at https://github.com/elastic/elasticsearch-dsl-py/blob/master/elasticsearch_dsl/document.py#L227)?\r\n\r\n        meta = es.update(\r\n            index=self._get_index(index),\r\n            doc_type=self._doc_type.name,\r\n            body={'doc': fields, 'doc_as_upsert': True, 'detect_noop': True},\r\n            **doc_meta\r\n        )"},"comment":{"url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/comments/137724321","html_url":"https://github.com/elastic/elasticsearch-dsl-py/issues/250#issuecomment-137724321","issue_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/250","id":137724321,"user":{"login":"HonzaKral","id":32132,"avatar_url":"https://avatars.githubusercontent.com/u/32132?v=3","gravatar_id":"","url":"https://api.github.com/users/HonzaKral","html_url":"https://github.com/HonzaKral","followers_url":"https://api.github.com/users/HonzaKral/followers","following_url":"https://api.github.com/users/HonzaKral/following{/other_user}","gists_url":"https://api.github.com/users/HonzaKral/gists{/gist_id}","starred_url":"https://api.github.com/users/HonzaKral/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HonzaKral/subscriptions","organizations_url":"https://api.github.com/users/HonzaKral/orgs","repos_url":"https://api.github.com/users/HonzaKral/repos","events_url":"https://api.github.com/users/HonzaKral/events{/privacy}","received_events_url":"https://api.github.com/users/HonzaKral/received_events","type":"User","site_admin":false},"created_at":"2015-09-04T12:33:32Z","updated_at":"2015-09-04T12:33:32Z","body":"No, there is no explicit upsert, but it behaves in a similar way - if the document exists it will get overridden, otherwise it will get created."}}