git.iko.soy/typeable/bloodhound
on master help sign in
add mapping name when creating template
commit28386b04d2d75a2080ad4ab3dd0bc77ce784d96c authorPeter Tillemans <pti@melexis.com> dateSat 27 Oct 2018, 11:26 (8 years ago) parent2916540
1 file changed+1−1
examples/Tweet.hs+1−1
examples/Tweet.hs+1−1
@@ -83,7 +83,7 @@ main = runBH' $ do
8383 True <- indexExists aliasName
8484
8585 -- 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]]
8787 let templateName = TemplateName "tweet-tpl"
8888 _ <- putTemplate idxTpl templateName
8989 True <- templateExists templateName