mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-25 01:19:02 +00:00
Map value field to double in MovavgIT (#40230)
We were accidentally not mapping the index, which meant dynamic mapping was choosing floats for the values. This led to enough loss of precision for the aggregated values to differ slightly from the test doubles, which accumulated into large differences in the holt output. This test fix adds an explicit mapping.
This commit is contained in:
parent
23d5f7babf
commit
78f737dad3
@ -26,6 +26,7 @@ import org.elasticsearch.action.search.SearchResponse;
|
||||
import org.elasticsearch.action.support.WriteRequest;
|
||||
import org.elasticsearch.client.Client;
|
||||
import org.elasticsearch.common.collect.EvictingQueue;
|
||||
import org.elasticsearch.common.xcontent.XContentFactory;
|
||||
import org.elasticsearch.search.aggregations.bucket.histogram.Histogram;
|
||||
import org.elasticsearch.search.aggregations.bucket.histogram.Histogram.Bucket;
|
||||
import org.elasticsearch.search.aggregations.metrics.Avg;
|
||||
@ -110,7 +111,12 @@ public class MovAvgIT extends ESIntegTestCase {
|
||||
|
||||
@Override
|
||||
public void setupSuiteScopeCluster() throws Exception {
|
||||
createIndex("idx");
|
||||
prepareCreate("idx").addMapping("type",
|
||||
XContentFactory.jsonBuilder().startObject().startObject("type")
|
||||
.startObject("properties")
|
||||
.startObject(VALUE_FIELD).field("type", "double").endObject()
|
||||
.endObject()
|
||||
.endObject().endObject()).execute().get();
|
||||
createIndex("idx_unmapped");
|
||||
List<IndexRequestBuilder> builders = new ArrayList<>();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user