git.iko.soy/typeable/bloodhound
on master help sign in
WIP: update index settings
9bc7ebdMichael Xavier
src/Database/Bloodhound/Types.hs+41−1
@@ -56,6 +56,7 @@ module Database.Bloodhound.Types
56 , Existence(..)
56 , Existence(..)
57 , NullValue(..)
57 , NullValue(..)
58 , IndexSettings(..)
58 , IndexSettings(..)
59+ , IndexSettingUpdate(..)
59 , IndexTemplate(..)
60 , IndexTemplate(..)
60 , Server(..)
61 , Server(..)
61 , Reply
62 , Reply
@@ -245,7 +246,7 @@ import qualified Data.Map.Strict as M
245import Data.Maybe
246import Data.Maybe
246import Data.Text (Text)
247import Data.Text (Text)
247import qualified Data.Text as T
248import qualified Data.Text as T
248−import Data.Time.Clock (UTCTime)
249+import Data.Time.Clock (UTCTime, NominalDiffTime)
249import qualified Data.Vector as V
250import qualified Data.Vector as V
250import GHC.Enum
251import GHC.Enum
251import GHC.Generics (Generic)
252import GHC.Generics (Generic)
@@ -347,6 +348,45 @@ data IndexSettings =
347defaultIndexSettings :: IndexSettings
348defaultIndexSettings :: IndexSettings
348defaultIndexSettings = IndexSettings (ShardCount 3) (ReplicaCount 2)
349defaultIndexSettings = IndexSettings (ShardCount 3) (ReplicaCount 2)
349
350
351+data IndexSettingUpdate = NumberOfReplicas Int
352+ | AutoExpandReplicas ReplicaBounds
353+ | BlocksReadOnly Bool
354+ | BlocksRead Bool
355+ | BlocksWrite Bool
356+ | BlocksMetaData Bool
357+ | RefreshInterval NominalDiffTime
358+ | IndexConcurrency Int
359+ | FailOnMergeFailure Bool
360+ | TranslogFlushThresholdOps Int
361+ | TranslogFlushThresholdSize Bytes
362+ | TranslogFlushThresholdPeriod NominalDiffTime
363+ | TranslogDisableFlush Bool
364+ | CacheFilterMaxSize (Maybe Bytes)
365+ | CacheFilterExpire (Maybe NominalDiffTime)
366+ | GatewaySnapshotInterval NominalDiffTime
367+ | RoutingAllocationDisable Bool
368+ | RoutingAllocationDisableNew Bool
369+ | RoutingAllocationDisableReplica Bool
370+ | RoutingAllocationEnable AllocationPolicy
371+ | RoutingAllocationShardsPerNode ShardCount
372+ | RecoveryInitialShards --TODO: shard count or quorum specifications
373+ | GCDeletes
374+ | TTLDisablePurge Bool
375+ | TranslogFSType FSType
376+ | TranslogCompoundFormat
377+ | TranslogCompoundOnFlush
378+ | WarmerEnabled Bool
379+ --TODO: figure out allocation options
380+
381+data AllocationPolicy = AllocAll
382+ | AllocPrimaries
383+ | AllocNewPrimaries
384+ | AllocNone
385+
386+data ReplicaBounds = ReplicasBounded Int Int
387+ | ReplicasLowerBounded Int
388+ | ReplicasUnbounded
389+
350{-| 'Reply' and 'Method' are type synonyms from 'Network.HTTP.Types.Method.Method' -}
390{-| 'Reply' and 'Method' are type synonyms from 'Network.HTTP.Types.Method.Method' -}
351type Reply = Network.HTTP.Client.Response L.ByteString
391type Reply = Network.HTTP.Client.Response L.ByteString
352type Method = NHTM.Method
392type Method = NHTM.Method
src/Database/Bloodhound/Types/Class.hs+2−2
@@ -3,9 +3,9 @@ module Database.Bloodhound.Types.Class
3 ( Seminearring(..) )
3 ( Seminearring(..) )
4 where
4 where
5
5
6−#if !MIN_VERSION_base(4,8,0)
6+-- #if !MIN_VERSION_base(4,8,0)
7import Data.Monoid
7import Data.Monoid
8−#endif
8+-- #endif
9
9
10class Monoid a => Seminearring a where
10class Monoid a => Seminearring a where
11 -- 0, +, *
11 -- 0, +, *