{"action":"closed","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/202","labels_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/202/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/202/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/202/events","html_url":"https://github.com/elastic/elasticsearch-dsl-py/issues/202","id":95271440,"number":202,"title":"empty string values don't work","user":{"login":"willkg","id":820826,"avatar_url":"https://avatars.githubusercontent.com/u/820826?v=3","gravatar_id":"","url":"https://api.github.com/users/willkg","html_url":"https://github.com/willkg","followers_url":"https://api.github.com/users/willkg/followers","following_url":"https://api.github.com/users/willkg/following{/other_user}","gists_url":"https://api.github.com/users/willkg/gists{/gist_id}","starred_url":"https://api.github.com/users/willkg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/willkg/subscriptions","organizations_url":"https://api.github.com/users/willkg/orgs","repos_url":"https://api.github.com/users/willkg/repos","events_url":"https://api.github.com/users/willkg/events{/privacy}","received_events_url":"https://api.github.com/users/willkg/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-15T19:27:56Z","updated_at":"2015-07-27T13:13:43Z","closed_at":"2015-07-27T13:13:43Z","body":"I'm using master tip (423c4f20d5f28599145712bd11ac9ce23e616f9a).\r\n\r\nIf I define a `DocType` like this:\r\n\r\n```\r\nimport elasticsearch_dsl as es_dsl\r\nfrom elasticsearch_dsl import Doctype\r\n\r\n\r\nclass ProductDocType(DocType):\r\n    id = es_dsl.Integer()\r\n    name = es_dsl.String(index='not_analyzed')\r\n```\r\n\r\nThen empty string names should end up with an empty string token. I should be able to do a term filter with the empty string and get back products with no name.\r\n\r\nHowever, it looks like `ObjectBase.to_dict` ignores empty values. So if I create an item with an empty value and save it, the empty value never makes it to Elasticsearch:\r\n\r\n```\r\nprod = ProductDocType(id=1, name='')\r\nprod.save()\r\n```\r\n\r\nThus when I later filter for `name=''`, I get nothing back:\r\n\r\n```\r\n>>> len(ProductDocType.search().filter('term', name='').execute())\r\n0\r\n```\r\n\r\nhttps://github.com/elastic/elasticsearch-dsl-py/blob/423c4f20d5f28599145712bd11ac9ce23e616f9a/elasticsearch_dsl/utils.py#L440\r\n\r\nWhat's the `not v` part for? Why reject falsey values?"}}