{"action":"created","issue":{"url":"https://api.github.com/repos/olivere/elastic/issues/39","labels_url":"https://api.github.com/repos/olivere/elastic/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/olivere/elastic/issues/39/comments","events_url":"https://api.github.com/repos/olivere/elastic/issues/39/events","html_url":"https://github.com/olivere/elastic/pull/39","id":57392227,"number":39,"title":"Feature Get/Put mappings","user":{"login":"tiago4orion","id":251478,"avatar_url":"https://avatars.githubusercontent.com/u/251478?v=3","gravatar_id":"","url":"https://api.github.com/users/tiago4orion","html_url":"https://github.com/tiago4orion","followers_url":"https://api.github.com/users/tiago4orion/followers","following_url":"https://api.github.com/users/tiago4orion/following{/other_user}","gists_url":"https://api.github.com/users/tiago4orion/gists{/gist_id}","starred_url":"https://api.github.com/users/tiago4orion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiago4orion/subscriptions","organizations_url":"https://api.github.com/users/tiago4orion/orgs","repos_url":"https://api.github.com/users/tiago4orion/repos","events_url":"https://api.github.com/users/tiago4orion/events{/privacy}","received_events_url":"https://api.github.com/users/tiago4orion/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-11T23:09:23Z","updated_at":"2015-02-12T10:33:36Z","closed_at":"2015-02-12T08:25:39Z","pull_request":{"url":"https://api.github.com/repos/olivere/elastic/pulls/39","html_url":"https://github.com/olivere/elastic/pull/39","diff_url":"https://github.com/olivere/elastic/pull/39.diff","patch_url":"https://github.com/olivere/elastic/pull/39.patch"},"body":"Added MappingsService and CreateMappingsService.\r\n\r\nBasic implementation of the mapping feature. I don't know if this is the best implementation. If you think that needs some improvements on the code, please, let me know and maybe I can improve that.\r\n\r\nUsage:\r\n\r\n```go\r\n\r\n// Create the mappings struct\r\n// Use .Body() to set this object mapping\r\n// Use .BodyString() to set a raw JSON string mapping\r\nmappings := map[string]TypeMappings{\r\n    \"tweet\": TypeMappings{\r\n        Properties: map[string]FieldProperty{\r\n            \"location\": FieldProperty{\r\n                Type: \"geo_point\",\r\n            },\r\n            \"suggest_field\": FieldProperty{\r\n                 Type:                       \"completion\",\r\n                 Analyzer:                   \"simple\",\r\n                 Payloads:                   true,\r\n                 PreserveSeparators:         true,\r\n                 PreservePositionIncrements: true,\r\n                 MaxInputLength:             50,\r\n            },\r\n            \"tags\": FieldProperty{\r\n                 Type: \"string\",\r\n            },\r\n        },\r\n    },\r\n}\r\n\r\n// Creating the mappings\r\nmappingsOk, err := client.CreateMappings().Index(\"elastic-test\").Type(\"tweet\").Body(mappings).Do()\r\n\r\nif err != nil || mappingsOk[\"acknowledged\"] != true {\r\n     panic(err)\r\n}\r\n\r\n// Getting the mappings\r\nresult_mappings, err := client.Mappings().Indices(\"elastic-test\").Do()\r\n\r\nif err != nil {\r\n    panic(err)\r\n}\r\n\r\neq := reflect.DeepEqual(mappings, result_mappings)\r\n\r\nif !eq {\r\n\tpanic(errors.New(\"Mappings are unequal!\"))\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/olivere/elastic/issues/comments/74049639","html_url":"https://github.com/olivere/elastic/pull/39#issuecomment-74049639","issue_url":"https://api.github.com/repos/olivere/elastic/issues/39","id":74049639,"user":{"login":"tiago4orion","id":251478,"avatar_url":"https://avatars.githubusercontent.com/u/251478?v=3","gravatar_id":"","url":"https://api.github.com/users/tiago4orion","html_url":"https://github.com/tiago4orion","followers_url":"https://api.github.com/users/tiago4orion/followers","following_url":"https://api.github.com/users/tiago4orion/following{/other_user}","gists_url":"https://api.github.com/users/tiago4orion/gists{/gist_id}","starred_url":"https://api.github.com/users/tiago4orion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiago4orion/subscriptions","organizations_url":"https://api.github.com/users/tiago4orion/orgs","repos_url":"https://api.github.com/users/tiago4orion/repos","events_url":"https://api.github.com/users/tiago4orion/events{/privacy}","received_events_url":"https://api.github.com/users/tiago4orion/received_events","type":"User","site_admin":false},"created_at":"2015-02-12T10:33:36Z","updated_at":"2015-02-12T10:33:36Z","body":"Hi there, thanks for the quick reply!\r\n\r\nI understand your position. I'm developing a service that requires strong control of elasticsearch mappings, then I need some mappings utility. If you want I can change that code for use interface{} instead... \r\n\r\nWhile the elastic do not support that, I will stick with this implementation.\r\n\r\nI didn't know the \"es\" tool, very nice! I will take a look at it, maybe it can help me!\r\n\r\nThanks!!"}}