mirror of
https://github.com/typeable/bloodhound.git
synced 2024-09-11 08:25:32 +03:00
Add Max metrics aggregation
This commit is contained in:
parent
c5603ff4e1
commit
977d2e8889
@ -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