git.iko.soy/typeable/bloodhound
on master help sign in
add mapping name when creating template
28386b0Peter Tillemans
examples/Tweet.hs+1−1
@@ -83,7 +83,7 @@ main = runBH' $ do
83 True <- indexExists aliasName
83 True <- indexExists aliasName
84
84
85 -- create a template so that if we just write into an index named tweet-2017-01-02, for instance, the index will be automatically created with the given mapping. This is a great idea for any ongoing indices because it makes them much easier to manage and rotate.
85 -- create a template so that if we just write into an index named tweet-2017-01-02, for instance, the index will be automatically created with the given mapping. This is a great idea for any ongoing indices because it makes them much easier to manage and rotate.
86− let idxTpl = IndexTemplate (TemplatePattern "tweet-*") (Just (IndexSettings (ShardCount 1) (ReplicaCount 1))) [toJSON TweetMapping]
86+ let idxTpl = IndexTemplate (TemplatePattern "tweet-*") (Just (IndexSettings (ShardCount 1) (ReplicaCount 1))) [object ["tweet" .= toJSON TweetMapping]]
87 let templateName = TemplateName "tweet-tpl"
87 let templateName = TemplateName "tweet-tpl"
88 _ <- putTemplate idxTpl templateName
88 _ <- putTemplate idxTpl templateName
89 True <- templateExists templateName
89 True <- templateExists templateName