{"action":"created","issue":{"url":"https://api.github.com/repos/olivere/elastic/issues/347","repository_url":"https://api.github.com/repos/olivere/elastic","labels_url":"https://api.github.com/repos/olivere/elastic/issues/347/labels{/name}","comments_url":"https://api.github.com/repos/olivere/elastic/issues/347/comments","events_url":"https://api.github.com/repos/olivere/elastic/issues/347/events","html_url":"https://github.com/olivere/elastic/issues/347","id":173514580,"number":347,"title":"Possible problem with UpdateService with partial doc","user":{"login":"jgoodall","id":664213,"avatar_url":"https://avatars.githubusercontent.com/u/664213?v=3","gravatar_id":"","url":"https://api.github.com/users/jgoodall","html_url":"https://github.com/jgoodall","followers_url":"https://api.github.com/users/jgoodall/followers","following_url":"https://api.github.com/users/jgoodall/following{/other_user}","gists_url":"https://api.github.com/users/jgoodall/gists{/gist_id}","starred_url":"https://api.github.com/users/jgoodall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgoodall/subscriptions","organizations_url":"https://api.github.com/users/jgoodall/orgs","repos_url":"https://api.github.com/users/jgoodall/repos","events_url":"https://api.github.com/users/jgoodall/events{/privacy}","received_events_url":"https://api.github.com/users/jgoodall/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-08-26T18:28:10Z","updated_at":"2016-09-02T08:44:06Z","closed_at":"2016-09-01T19:30:49Z","body":"Using elastic.v3, trying to update a field in an existing document using the UpdateService and I get unexpected results. \r\n\r\nIf I do the following the field (`handled`) is updated properly: \r\n\r\n```\r\ncurl -XPOST \"http://localhost:9200/<index>/<type>/<id>/_update\" -d'\r\n{\r\n   \"doc\": {\r\n      \"handled\": true\r\n   }\r\n}'\r\n```\r\n\r\nIf I do this in my code with a new object (`doc`) with only the `handled` field set:\r\n\r\n```\r\n\tres, err := Client.Update().\r\n\t\tIndex(index).\r\n\t\tType(docType).\r\n\t\tId(id).\r\n\t\tDoc(doc).\r\n\t\tRefresh(true).\r\n\t\tDo()\r\n```\r\n\r\nI do not get an error, but `Created` is false in the response. If instead of passing `Doc` the new struct with the updated values, I pass it json (`[]byte`), I get an error:\r\n\r\n```\r\nelastic: Error 500 (Internal Server Error): Compressor detection can only be called on some xcontent bytes or compressed xcontent bytes [type=not_x_content_exception]\r\n```\r\n\r\nSame thing if I pass it a json string. What exactly is supposed to be in `Doc` argument? Or am I just doing it wrong?\r\n"},"comment":{"url":"https://api.github.com/repos/olivere/elastic/issues/comments/244318245","html_url":"https://github.com/olivere/elastic/issues/347#issuecomment-244318245","issue_url":"https://api.github.com/repos/olivere/elastic/issues/347","id":244318245,"user":{"login":"olivere","id":134848,"avatar_url":"https://avatars.githubusercontent.com/u/134848?v=3","gravatar_id":"","url":"https://api.github.com/users/olivere","html_url":"https://github.com/olivere","followers_url":"https://api.github.com/users/olivere/followers","following_url":"https://api.github.com/users/olivere/following{/other_user}","gists_url":"https://api.github.com/users/olivere/gists{/gist_id}","starred_url":"https://api.github.com/users/olivere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olivere/subscriptions","organizations_url":"https://api.github.com/users/olivere/orgs","repos_url":"https://api.github.com/users/olivere/repos","events_url":"https://api.github.com/users/olivere/events{/privacy}","received_events_url":"https://api.github.com/users/olivere/received_events","type":"User","site_admin":false},"created_at":"2016-09-02T08:44:06Z","updated_at":"2016-09-02T08:44:06Z","body":"Sure. It should be in line with the syntax described in the [Update API](https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-update.html). If it's not, let me know and we see what we can do about it."}}
{"actor":{"display_login":"olivere"}}