@@ -268,10 +268,13 @@ mkEsScribe
268268 -> IndexName v
269269 -- ^ Treated as a prefix if index sharding is enabled
270270 -> MappingName v
271+ -> Value
272+ -- ^ Index mapping value. Use 'baseMapping' as default value
273+ -- constructor.
271274 -> PermitFunc
272275 -> Verbosity
273276 -> IO Scribe
274−mkEsScribe cfg@EsScribeCfg {..} env ix mapping permit verb = do
277+mkEsScribe cfg@EsScribeCfg {..} env ix mapping mappingValue permit verb = do
275278 q <- newTBMQueueIO $ unEsQueueSize essQueueSize
276279 endSig <- newEmptyMVar
277280
@@ -293,7 +296,7 @@ mkEsScribe cfg@EsScribeCfg {..} env ix mapping permit verb = do
293296 r1 <- createIndex prx essIndexSettings ix
294297 unless (statusIsSuccessful (responseStatus r1)) $
295298 liftIO $ EX.throwIO (CouldNotCreateIndex r1)
296− r2 <- putMapping prx ix mapping base
299+ r2 <- putMapping prx ix mapping mappingValue
297300 unless (statusIsSuccessful (responseStatus r2)) $
298301 liftIO $ EX.throwIO (CouldNotCreateMapping r2)
299302
@@ -318,8 +321,7 @@ mkEsScribe cfg@EsScribeCfg {..} env ix mapping permit verb = do
318321 shardingEnabled = case essIndexSharding of
319322 NoIndexSharding -> False
320323 _ -> True
321− tpl = toIndexTemplate prx (toTemplatePattern prx (ixn <> "-*")) (Just essIndexSettings) [toJSON base]
322− base = baseMapping prx mapping
324+ tpl = toIndexTemplate prx (toTemplatePattern prx (ixn <> "-*")) (Just essIndexSettings) [mappingValue]
323325 ixn = fromIndexName prx ix
324326 itemJson' :: LogItem a => Item a -> Value
325327 itemJson' i