@@ -237,6 +237,7 @@ module Database.Bloodhound.Types
237 , Bucket(..)
237 , Bucket(..)
238 , BucketAggregation(..)
238 , BucketAggregation(..)
239 , TermsAggregation(..)
239 , TermsAggregation(..)
240+ , MissingAggregation(..)
240 , ValueCountAggregation(..)
241 , ValueCountAggregation(..)
241 , FilterAggregation(..)
242 , FilterAggregation(..)
242 , DateHistogramAggregation(..)
243 , DateHistogramAggregation(..)
@@ -1544,8 +1545,12 @@ data Aggregation = TermsAgg TermsAggregation
1544 | DateHistogramAgg DateHistogramAggregation
1545 | DateHistogramAgg DateHistogramAggregation
1545 | ValueCountAgg ValueCountAggregation
1546 | ValueCountAgg ValueCountAggregation
1546 | FilterAgg FilterAggregation
1547 | FilterAgg FilterAggregation
1547− | DateRangeAgg DateRangeAggregation deriving (Eq, Show, Generic, Typeable)
1548+ | DateRangeAgg DateRangeAggregation
1549+ | MissingAgg MissingAggregation deriving (Eq, Show, Generic, Typeable)
1551+data MissingAggregation = MissingAggregation
1553+ } deriving (Eq, Show, Generic, Typeable)
1550data TermsAggregation = TermsAggregation { term :: Either Text Text
1555data TermsAggregation = TermsAggregation { term :: Either Text Text
1551 , termInclude :: Maybe TermInclusion
1556 , termInclude :: Maybe TermInclusion
@@ -1705,6 +1710,8 @@ instance ToJSON Aggregation where
1705 , "aggs" .= ags]
1710 , "aggs" .= ags]
1706 toJSON (DateRangeAgg a) = object [ "date_range" .= a
1711 toJSON (DateRangeAgg a) = object [ "date_range" .= a
1713+ toJSON (MissingAgg (MissingAggregation{..})) =
1714+ object ["missing" .= object ["field" .= maField]]
1709instance ToJSON DateRangeAggregation where
1716instance ToJSON DateRangeAggregation where
1710 toJSON DateRangeAggregation {..} =
1717 toJSON DateRangeAggregation {..} =