add mapping name when creating template

This commit is contained in:
Peter Tillemans 2018-10-27 11:26:17 +02:00
parent 2916540264
commit 28386b04d2

View File

@ -83,7 +83,7 @@ main = runBH' $ do
True <- indexExists aliasName
-- 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.
let idxTpl = IndexTemplate (TemplatePattern "tweet-*") (Just (IndexSettings (ShardCount 1) (ReplicaCount 1))) [toJSON TweetMapping]
let idxTpl = IndexTemplate (TemplatePattern "tweet-*") (Just (IndexSettings (ShardCount 1) (ReplicaCount 1))) [object ["tweet" .= toJSON TweetMapping]]
let templateName = TemplateName "tweet-tpl"
_ <- putTemplate idxTpl templateName
True <- templateExists templateName