git.iko.soy/typeable/bloodhound
on master help sign in
Revert to original TermsResult FromJSON instance

For the sake of changing as little as possible

commit193c50af9d32be4deb93b219d4bd988c732082c0 authorMHova <mho@sumall.com> dateThu 21 Jan 2016, 09:51 (11 years ago) parent8f0a40c
1 file changed+5−5
src/Database/Bloodhound/Types.hs+5−5
src/Database/Bloodhound/Types.hs+5−5
@@ -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 <$>