@@ -914,6 +914,7 @@ instance Arbitrary AnalyzerDefinition where arbitrary = sopArbitrary; shrink = g
914914instance Arbitrary Analysis where arbitrary = sopArbitrary; shrink = genericShrink
915915instance Arbitrary Tokenizer where arbitrary = sopArbitrary; shrink = genericShrink
916916instance Arbitrary UpdatableIndexSetting where arbitrary = sopArbitrary; shrink = genericShrink
917+instance Arbitrary Compression where arbitrary = sopArbitrary; shrink = genericShrink
917918instance Arbitrary Bytes where arbitrary = sopArbitrary; shrink = genericShrink
918919instance Arbitrary AllocationPolicy where arbitrary = sopArbitrary; shrink = genericShrink
919920instance Arbitrary InitialShardCount where arbitrary = sopArbitrary; shrink = genericShrink
@@ -1648,6 +1649,25 @@ main = hspec $ do
16481649 updates
16491650 )
16501651
1652+ it "accepts default compression codec" $ when' (atleast es50) $ withTestEnv $ do
1653+ _ <- deleteExampleIndex
1654+ let updates = [CompressionSetting CompressionDefault]
1655+ createResp <- createIndexWith (updates ++ [NumberOfReplicas (ReplicaCount 0)]) 1 testIndex
1656+ liftIO $ validateStatus createResp 200
1657+ getResp <- getIndexSettings testIndex
1658+ liftIO $ getResp `shouldBe` Right
1659+ (IndexSettingsSummary testIndex (IndexSettings (ShardCount 1) (ReplicaCount 0)) updates)
1660+
1661+ it "accepts best compression codec" $ when' (atleast es50) $ withTestEnv $ do
1662+ _ <- deleteExampleIndex
1663+ let updates = [CompressionSetting CompressionBest]
1664+ createResp <- createIndexWith (updates ++ [NumberOfReplicas (ReplicaCount 0)]) 1 testIndex
1665+ liftIO $ validateStatus createResp 200
1666+ getResp <- getIndexSettings testIndex
1667+ liftIO $ getResp `shouldBe` Right
1668+ (IndexSettingsSummary testIndex (IndexSettings (ShardCount 1) (ReplicaCount 0)) updates)
1669+
1670+
16511671 describe "Index Optimization" $ do
16521672 it "returns a successful response upon completion" $ withTestEnv $ do
16531673 _ <- createExampleIndex