{"action":"closed","issue":{"url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/216","labels_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/216/labels{/name}","comments_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/216/comments","events_url":"https://api.github.com/repos/elastic/elasticsearch-dsl-py/issues/216/events","html_url":"https://github.com/elastic/elasticsearch-dsl-py/issues/216","id":96825151,"number":216,"title":"[QUESTION] analyzer to dict while setting up index","user":{"login":"mieciu","id":2097938,"avatar_url":"https://avatars.githubusercontent.com/u/2097938?v=3","gravatar_id":"","url":"https://api.github.com/users/mieciu","html_url":"https://github.com/mieciu","followers_url":"https://api.github.com/users/mieciu/followers","following_url":"https://api.github.com/users/mieciu/following{/other_user}","gists_url":"https://api.github.com/users/mieciu/gists{/gist_id}","starred_url":"https://api.github.com/users/mieciu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mieciu/subscriptions","organizations_url":"https://api.github.com/users/mieciu/orgs","repos_url":"https://api.github.com/users/mieciu/repos","events_url":"https://api.github.com/users/mieciu/events{/privacy}","received_events_url":"https://api.github.com/users/mieciu/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-23T14:15:37Z","updated_at":"2015-07-24T12:39:33Z","closed_at":"2015-07-24T12:39:33Z","body":"Hey,\r\n\r\nFirst of all, congrats on making this DSL -> it's really well engineered and just pleasurable to use!!\r\n\r\nI was playing with it today, and I discovered such a behaviour:\r\n```\r\n>>> bug_analyzer = analyzer('bug_analyzer', tokenizer=tokenizer('default_nGram', 'nGram'))\r\n>>> my_index.settings(analysis=bug_analyzer)\r\n<elasticsearch_dsl.index.Index object at 0x7f7e0ae0d190>\r\n>>> my_index.create()\r\nTraceback (most recent call last):\r\n  File \"<console>\", line 1, in <module>\r\n  ...\r\n  File \"/app/.heroku/python/lib/python2.7/site-packages/elasticsearch/serializer.py\", line 47, in dumps\r\n    raise SerializationError(data, e)\r\nSerializationError: ({'settings': {'analysis': CustomAnalyzer(tokenizer=NGramTokenizer())}}, TypeError(\"Unable to serialize CustomAnalyzer(tokenizer=NGramTokenizer()) (type: <class 'elasticsearch_dsl.analysis.CustomAnalyzer'>)\",))\r\n>>> my_index.settings(analysis=bug_analyzer.to_dict()\r\nDisplay all 191 possibilities? (y or n)\r\n\r\n>>> my_index.settings(analysis=bug_analyzer.to_dict())\r\n<elasticsearch_dsl.index.Index object at 0x7f7e0ae0d190>\r\n>>> my_index.create()\r\n```\r\n\r\nMy question is, was it intended to explicitly use that `to_dict()` method? As from high level DSL I'd expect\r\n`my_index.settings(analysis=bug_analyze)` to just work, even with passing several analysers (as a list/tuple/....).\r\n\r\nI'd really like to make a PR with this analyzer serialisation, but perhaps it is some deeper sense  in preventing from having such an interface?\r\n\r\n"}}