@@ -1802,11 +1802,11 @@ instance FromJSON BucketValue where
18021802 parseJSON _ = mempty
18031803
18041804instance FromJSON TermsResult where
1805− parseJSON = withObject "TermsResult" $ \o -> do
1806− termKey <- o .: "key"
1807− termsDocCount <- o .: "doc_count"
1808− termsAggs <- o .:? "aggregations"
1809− return TermsResult{..}
1805+ parseJSON (Object v) = TermsResult <$>
1806+ v .: "key" <*>
1807+ v .: "doc_count" <*>
1808+ v .:? "aggregations"
1809+ parseJSON _ = mempty
18101810
18111811instance FromJSON DateHistogramResult where
18121812 parseJSON (Object v) = DateHistogramResult <$>