git.iko.soy/typeable/bloodhound
on master help sign in
Paper over some API differences in ES <= 1.5.2
commitee2492134a388e36f5c500b7d1dc0e1d2031ccc4 authorMichael Xavier <michael@michaelxavier.net> dateWed 10 Aug 2016, 18:45 (10 years ago) parent69eeed4
1 file changed+7−7
src/Database/Bloodhound/Types.hs+7−7
src/Database/Bloodhound/Types.hs+7−7
@@ -3922,8 +3922,8 @@ data NodeThreadPoolsInfo = NodeThreadPoolsInfo {
39223922 nodeThreadPoolsRefresh :: NodeThreadPoolInfo
39233923 , nodeThreadPoolsManagement :: NodeThreadPoolInfo
39243924 , nodeThreadPoolsPercolate :: NodeThreadPoolInfo
3925− , nodeThreadPoolsListener :: NodeThreadPoolInfo
3926− , nodeThreadPoolsFetchShardStarted :: NodeThreadPoolInfo
3925+ , nodeThreadPoolsListener :: Maybe NodeThreadPoolInfo
3926+ , nodeThreadPoolsFetchShardStarted :: Maybe NodeThreadPoolInfo
39273927 , nodeThreadPoolsSearch :: NodeThreadPoolInfo
39283928 , nodeThreadPoolsFlush :: NodeThreadPoolInfo
39293929 , nodeThreadPoolsWarmer :: NodeThreadPoolInfo
@@ -3933,7 +3933,7 @@ data NodeThreadPoolsInfo = NodeThreadPoolsInfo {
39333933 , nodeThreadPoolsMerge :: NodeThreadPoolInfo
39343934 , nodeThreadPoolsSnapshot :: NodeThreadPoolInfo
39353935 , nodeThreadPoolsGet :: NodeThreadPoolInfo
3936− , nodeThreadPoolsFetchShardStore :: NodeThreadPoolInfo
3936+ , nodeThreadPoolsFetchShardStore :: Maybe NodeThreadPoolInfo
39373937 , nodeThreadPoolsIndex :: NodeThreadPoolInfo
39383938 , nodeThreadPoolsGeneric :: NodeThreadPoolInfo
39393939 } deriving (Eq, Show, Generic, Typeable)
@@ -4467,8 +4467,8 @@ instance FromJSON NodeThreadPoolsInfo where
44674467 parse o = NodeThreadPoolsInfo <$> o .: "refresh"
44684468 <*> o .: "management"
44694469 <*> o .: "percolate"
4470− <*> o .: "listener"
4471− <*> o .: "fetch_shard_started"
4470+ <*> o .:? "listener"
4471+ <*> o .:? "fetch_shard_started"
44724472 <*> o .: "search"
44734473 <*> o .: "flush"
44744474 <*> o .: "warmer"
@@ -4478,7 +4478,7 @@ instance FromJSON NodeThreadPoolsInfo where
44784478 <*> o .: "merge"
44794479 <*> o .: "snapshot"
44804480 <*> o .: "get"
4481− <*> o .: "fetch_shard_store"
4481+ <*> o .:? "fetch_shard_store"
44824482 <*> o .: "index"
44834483 <*> o .: "generic"
44844484
@@ -4532,7 +4532,7 @@ instance FromJSON ThreadPoolType where
45324532instance FromJSON NodeTransportInfo where
45334533 parseJSON = withObject "NodeTransportInfo" parse
45344534 where
4535− parse o = NodeTransportInfo <$> (parseProfiles =<< o .: "profiles")
4535+ parse o = NodeTransportInfo <$> (maybe (return mempty) parseProfiles =<< o .:? "profiles")
45364536 <*> parseJSON (Object o)
45374537 parseProfiles (Object o) | HM.null o = return []
45384538 parseProfiles v@(Array _) = parseJSON v