added maximum mapping size

This commit is contained in:
Andrew Martin 2017-03-21 13:06:16 -04:00
parent e34d30285b
commit a7deed6a82

View File

@ -582,6 +582,7 @@ data UpdatableIndexSetting = NumberOfReplicas ReplicaCount
| IndexCompoundFormat CompoundFormat
| IndexCompoundOnFlush Bool
| WarmerEnabled Bool
| MappingTotalFieldsLimit Int
deriving (Eq, Show, Generic, Typeable)
data AllocationPolicy = AllocAll
@ -2987,6 +2988,7 @@ instance ToJSON UpdatableIndexSetting where
toJSON (BlocksRead x) = oPath ("blocks" :| ["read"]) x
toJSON (BlocksWrite x) = oPath ("blocks" :| ["write"]) x
toJSON (BlocksMetaData x) = oPath ("blocks" :| ["metadata"]) x
toJSON (MappingTotalFieldsLimit x) = oPath ("index" :| ["mapping","total_fields","limit"]) x
instance FromJSON UpdatableIndexSetting where
parseJSON = withObject "UpdatableIndexSetting" parse
@ -3018,6 +3020,7 @@ instance FromJSON UpdatableIndexSetting where
<|> blocksRead `taggedAt` ["blocks", "read"]
<|> blocksWrite `taggedAt` ["blocks", "write"]
<|> blocksMetaData `taggedAt` ["blocks", "metadata"]
<|> mappingTotalFieldsLimit `taggedAt` ["index", "mapping", "total_fields", "limit"]
where taggedAt f ks = taggedAt' f (Object o) ks
taggedAt' f v [] = f =<< (parseJSON v <|> (parseJSON (unStringlyTypeJSON v)))
taggedAt' f v (k:ks) = withObject "Object" (\o -> do v' <- o .: k
@ -3050,6 +3053,7 @@ instance FromJSON UpdatableIndexSetting where
blocksRead = pure . BlocksRead
blocksWrite = pure . BlocksWrite
blocksMetaData = pure . BlocksMetaData
mappingTotalFieldsLimit = pure . MappingTotalFieldsLimit
instance FromJSON IndexSettingsSummary where
parseJSON = withObject "IndexSettingsSummary" parse