use of com.enonic.xp.aggregation.DateRangeBucket in project xp by enonic.
the class AggregationMapper method serializeBucket.
private static void serializeBucket(final MapGenerator gen, final Bucket value) {
gen.map();
gen.value("key", value.getKey());
gen.value("docCount", value.getDocCount());
if (value instanceof DateRangeBucket) {
serializeDateBucket(gen, (DateRangeBucket) value);
} else if (value instanceof NumericRangeBucket) {
serializeNumericBucket(gen, (NumericRangeBucket) value);
}
final Aggregations subAggregations = value.getSubAggregations();
if (subAggregations != null) {
serializeAggregations(gen, subAggregations);
}
gen.end();
}
use of com.enonic.xp.aggregation.DateRangeBucket in project xp by enonic.
the class AggregationMapper method serializeBucket.
private static void serializeBucket(final MapGenerator gen, final Bucket value) {
gen.map();
gen.value("key", value.getKey());
gen.value("docCount", value.getDocCount());
if (value instanceof DateRangeBucket) {
serializeDateBucket(gen, (DateRangeBucket) value);
} else if (value instanceof NumericRangeBucket) {
serializeNumericBucket(gen, (NumericRangeBucket) value);
}
final Aggregations subAggregations = value.getSubAggregations();
if (subAggregations != null) {
serializeAggregations(gen, subAggregations);
}
gen.end();
}
use of com.enonic.xp.aggregation.DateRangeBucket in project xp by enonic.
the class DateRangeAggregationTest method verifyBucket.
private void verifyBucket(final Bucket bucket, final int count) {
assertTrue(bucket instanceof DateRangeBucket);
final DateRangeBucket buck = (DateRangeBucket) bucket;
assertEquals(count, buck.getDocCount());
}
Aggregations