@@ -268,10 +268,13 @@ mkEsScribe
268 -> IndexName v
268 -> IndexName v
269 -- ^ Treated as a prefix if index sharding is enabled
269 -- ^ Treated as a prefix if index sharding is enabled
270 -> MappingName v
270 -> MappingName v
272+ -- ^ Index mapping value. Use 'baseMapping' as default value
271 -> PermitFunc
274 -> PermitFunc
272 -> Verbosity
275 -> Verbosity
273 -> IO Scribe
276 -> IO Scribe
274−mkEsScribe cfg@EsScribeCfg {..} env ix mapping permit verb = do
277+mkEsScribe cfg@EsScribeCfg {..} env ix mapping mappingValue permit verb = do
275 q <- newTBMQueueIO $ unEsQueueSize essQueueSize
278 q <- newTBMQueueIO $ unEsQueueSize essQueueSize
276 endSig <- newEmptyMVar
279 endSig <- newEmptyMVar
@@ -293,7 +296,7 @@ mkEsScribe cfg@EsScribeCfg {..} env ix mapping permit verb = do
293 r1 <- createIndex prx essIndexSettings ix
296 r1 <- createIndex prx essIndexSettings ix
294 unless (statusIsSuccessful (responseStatus r1)) $
297 unless (statusIsSuccessful (responseStatus r1)) $
295 liftIO $ EX.throwIO (CouldNotCreateIndex r1)
298 liftIO $ EX.throwIO (CouldNotCreateIndex r1)
296− r2 <- putMapping prx ix mapping base
299+ r2 <- putMapping prx ix mapping mappingValue
297 unless (statusIsSuccessful (responseStatus r2)) $
300 unless (statusIsSuccessful (responseStatus r2)) $
298 liftIO $ EX.throwIO (CouldNotCreateMapping r2)
301 liftIO $ EX.throwIO (CouldNotCreateMapping r2)
@@ -318,8 +321,7 @@ mkEsScribe cfg@EsScribeCfg {..} env ix mapping permit verb = do
318 shardingEnabled = case essIndexSharding of
321 shardingEnabled = case essIndexSharding of
319 NoIndexSharding -> False
322 NoIndexSharding -> False
320 _ -> True
323 _ -> True
321− tpl = toIndexTemplate prx (toTemplatePattern prx (ixn <> "-*")) (Just essIndexSettings) [toJSON base]
324+ tpl = toIndexTemplate prx (toTemplatePattern prx (ixn <> "-*")) (Just essIndexSettings) [mappingValue]
322− base = baseMapping prx mapping
323 ixn = fromIndexName prx ix
325 ixn = fromIndexName prx ix
324 itemJson' :: LogItem a => Item a -> Value
326 itemJson' :: LogItem a => Item a -> Value
325 itemJson' i
327 itemJson' i