Search in sources :

Example 1 with PipelineAggregationBuilder

use of org.elasticsearch.search.aggregations.PipelineAggregationBuilder in project elasticsearch by elastic.

the class MovAvgTests method testDefaultParsing.

public void testDefaultParsing() throws Exception {
    MovAvgPipelineAggregationBuilder expected = new MovAvgPipelineAggregationBuilder("commits_moving_avg", "commits");
    String json = "{" + "    \"commits_moving_avg\": {" + "        \"moving_avg\": {" + "            \"buckets_path\": \"commits\"" + "        }" + "    }" + "}";
    PipelineAggregationBuilder newAgg = parse(createParser(JsonXContent.jsonXContent, json));
    assertNotSame(newAgg, expected);
    assertEquals(expected, newAgg);
    assertEquals(expected.hashCode(), newAgg.hashCode());
}
Also used : MovAvgPipelineAggregationBuilder(org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregationBuilder) PipelineAggregationBuilder(org.elasticsearch.search.aggregations.PipelineAggregationBuilder) MovAvgPipelineAggregationBuilder(org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregationBuilder)

Aggregations

PipelineAggregationBuilder (org.elasticsearch.search.aggregations.PipelineAggregationBuilder)1 MovAvgPipelineAggregationBuilder (org.elasticsearch.search.aggregations.pipeline.movavg.MovAvgPipelineAggregationBuilder)1