mirror of
https://github.com/typeable/bloodhound.git
synced 2024-11-29 23:52:20 +03:00
Add Max metrics aggregation
This commit is contained in:
parent
4fa060a90e
commit
529c2fc68e
@ -27,6 +27,7 @@ mkAggregations name aggregation = M.insert name aggregation emptyAggregations
|
||||
|
||||
data Aggregation = TermsAgg TermsAggregation
|
||||
| CardinalityAgg CardinalityAggregation
|
||||
| MaxAgg MaxAggregation
|
||||
| DateHistogramAgg DateHistogramAggregation
|
||||
| ValueCountAgg ValueCountAggregation
|
||||
| FilterAgg FilterAggregation
|
||||
@ -58,6 +59,9 @@ instance ToJSON Aggregation where
|
||||
]
|
||||
]
|
||||
|
||||
toJSON (MaxAgg (MaxAggregation field)) =
|
||||
object ["max" .= omitNulls [ "field" .= field ]]
|
||||
|
||||
toJSON (DateHistogramAgg
|
||||
(DateHistogramAggregation field interval format
|
||||
preZone postZone preOffset postOffset dateHistoAggs)) =
|
||||
@ -125,6 +129,10 @@ data CardinalityAggregation = CardinalityAggregation
|
||||
precisionThreshold :: Maybe Int
|
||||
} deriving (Eq, Show)
|
||||
|
||||
data MaxAggregation = MaxAggregation
|
||||
{ maxField :: FieldName
|
||||
} deriving (Eq, Show)
|
||||
|
||||
data DateHistogramAggregation = DateHistogramAggregation
|
||||
{ dateField :: FieldName
|
||||
, dateInterval :: Interval
|
||||
|
Loading…
Reference in New Issue
Block a user