on master help sign in
Minor doc additions
commite98b6646256daf722a24fd80b31328d5eab2e29d authorMichael Xavier <michael@michaelxavier.net> dateTue 11 Jul 2017, 11:42 (9 years ago) parent9a00f2a
2 files changed+18−4
katip-elasticsearch/src/Katip/Scribes/ElasticSearch.hs+5−4 katip-elasticsearch/src/Katip/Scribes/ElasticSearch/Internal.hs+13
katip-elasticsearch/src/Katip/Scribes/ElasticSearch.hs+5−4
@@ -1,7 +1,8 @@
11-- | Includes a scribe that can be used to log structured, JSON log
22-- messages to ElasticSearch. These logs can be explored easily using
33-- <https://www.elastic.co/products/kibana kibana> or your tool of
4−-- choice.
4+-- choice. Supports ElasticSearch servers with version 1.x or 5.x by
5+-- way of different configs.
56--
67-- == __Important Note on Index Settings__
78--
@@ -25,6 +26,9 @@ module Katip.Scribes.ElasticSearch
2526 , mkEsQueueSize
2627 , EsPoolSize
2728 , mkEsPoolSize
29+ , IndexShardingPolicy(..)
30+ , IndexNameSegment(..)
31+ -- ** EsScribeCfg and fields
2832 , EsScribeCfg
2933 , essRetryPolicy
3034 , essQueueSize
@@ -32,15 +36,12 @@ module Katip.Scribes.ElasticSearch
3236 , essAnnotateTypes
3337 , essIndexSettings
3438 , essIndexSharding
35− , IndexShardingPolicy(..)
36− , IndexNameSegment(..)
3739 , defaultEsScribeCfg
3840 , defaultEsScribeCfgV1
3941 , defaultEsScribeCfgV5
4042 -- * Utilities
4143 , mkDocId
4244 , module Katip.Scribes.ElasticSearch.Annotations
43− , roundToSunday
4445 ) where
4546
4647
katip-elasticsearch/src/Katip/Scribes/ElasticSearch/Internal.hs+13
@@ -47,6 +47,10 @@ import Katip.Scribes.ElasticSearch.Annotations
4747-------------------------------------------------------------------------------
4848
4949
50+-- | EsScribeCfg now carries a type variable for the version of
51+-- ElasticSearch it targets, either 'ESV1' or 'ESV5'. You can use
52+-- 'defaultEsScribeCfgV1' and 'defaultESScribeCfgV5' for a good
53+-- starting point depending on the ES version you have.
5054data EsScribeCfg v = EsScribeCfg {
5155 essRetryPolicy :: RetryPolicy
5256 -- ^ Retry policy when there are errors sending logs to the server
@@ -68,6 +72,9 @@ data EsScribeCfg v = EsScribeCfg {
6872 -- querying transparently remove the type annotations if this is
6973 -- enabled.
7074 , essIndexSettings :: IndexSettings v
75+ -- ^ This will be the IndexSettings type from the appropriate
76+ -- bloodhound module, either @Database.V1.Bloodhound@ or
77+ -- @Database.V5.Bloodhound@
7178 , essIndexSharding :: IndexShardingPolicy
7279 } deriving (Typeable)
7380
@@ -239,6 +246,12 @@ instance Exception EsScribeSetupError
239246
240247
241248-------------------------------------------------------------------------------
249+-- | The Any field tagged with a @v@ corresponds to the type of the
250+-- same name in the corresponding @bloodhound@ module. For instance,
251+-- if you are configuring for ElasticSearch version 1, import
252+-- @Database.V1.Bloodhound@ and @BHEnv v@ will refer to @BHEnv@ from
253+-- that module, @IndexName v@ will repsond to @IndexName@ from that
254+-- module, etc.
242255mkEsScribe
243256 :: forall v. ( ESVersion v
244257 , MonadIO (BH v IO)