Revert "Aggregations: Pass extended bounds into HistogramAggregator when creating an unmapped aggregator"

This reverts commit e1bf9798bf.
This commit is contained in:
Colin Goodheart-Smithe 2015-11-13 12:48:51 +00:00
parent e1bf9798bf
commit be64bfb135
2 changed files with 1 additions and 34 deletions

View File

@ -173,7 +173,7 @@ public class HistogramAggregator extends BucketsAggregator {
@Override
protected Aggregator createUnmapped(AggregationContext aggregationContext, Aggregator parent, List<PipelineAggregator> pipelineAggregators,
Map<String, Object> metaData) throws IOException {
return new HistogramAggregator(name, factories, rounding, order, keyed, minDocCount, extendedBounds, null, config.formatter(),
return new HistogramAggregator(name, factories, rounding, order, keyed, minDocCount, null, null, config.formatter(),
histogramFactory, aggregationContext, parent, pipelineAggregators, metaData);
}

View File

@ -892,39 +892,6 @@ public class HistogramTests extends ESIntegTestCase {
}
}
public void testPartiallyUnmappedWithExtendedBounds() throws Exception {
SearchResponse response = client()
.prepareSearch("idx", "idx_unmapped")
.addAggregation(
histogram("histo").field(SINGLE_VALUED_FIELD_NAME).interval(interval)
.extendedBounds((long) -1 * 2 * interval, (long) valueCounts.length * interval)).execute().actionGet();
assertSearchResponse(response);
Histogram histo = response.getAggregations().get("histo");
assertThat(histo, notNullValue());
assertThat(histo.getName(), equalTo("histo"));
List<? extends Bucket> buckets = histo.getBuckets();
assertThat(buckets.size(), equalTo(numValueBuckets + 3));
Histogram.Bucket bucket = buckets.get(0);
assertThat(bucket, notNullValue());
assertThat(((Number) bucket.getKey()).longValue(), equalTo((long) -1 * 2 * interval));
assertThat(bucket.getDocCount(), equalTo(0l));
bucket = buckets.get(1);
assertThat(bucket, notNullValue());
assertThat(((Number) bucket.getKey()).longValue(), equalTo((long) -1 * interval));
assertThat(bucket.getDocCount(), equalTo(0l));
for (int i = 2; i < numValueBuckets + 2; ++i) {
bucket = buckets.get(i);
assertThat(bucket, notNullValue());
assertThat(((Number) bucket.getKey()).longValue(), equalTo((long) (i - 2) * interval));
assertThat(bucket.getDocCount(), equalTo(valueCounts[i - 2]));
}
}
public void testEmptyAggregation() throws Exception {
SearchResponse searchResponse = client().prepareSearch("empty_bucket_idx")
.setQuery(matchAllQuery())