use of org.elasticsearch.search.aggregations.bucket.sampler.SamplerAggregationBuilder in project fess by codelibs.
the class EsAbstractConditionAggregation method regSamplerA.
protected SamplerAggregationBuilder regSamplerA(String name) {
SamplerAggregationBuilder builder = AggregationBuilders.sampler(name);
regA(builder);
return builder;
}
use of org.elasticsearch.search.aggregations.bucket.sampler.SamplerAggregationBuilder in project fess by codelibs.
the class BsUserCA method sampler.
public void sampler(String name, ConditionOptionCall<SamplerAggregationBuilder> opLambda, OperatorCall<BsUserCA> aggsLambda) {
SamplerAggregationBuilder builder = regSamplerA(name);
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
UserCA ca = new UserCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
use of org.elasticsearch.search.aggregations.bucket.sampler.SamplerAggregationBuilder in project elasticsearch by elastic.
the class SamplerIT method testPartiallyUnmappedChildAggNoDiversity.
public void testPartiallyUnmappedChildAggNoDiversity() throws Exception {
SamplerAggregationBuilder sampleAgg = sampler("sample").shardSize(100);
sampleAgg.subAggregation(terms("authors").field("author"));
SearchResponse response = client().prepareSearch("idx_unmapped", "test").setSearchType(SearchType.QUERY_THEN_FETCH).setQuery(new TermQueryBuilder("genre", "fantasy")).setFrom(0).setSize(60).setExplain(true).addAggregation(sampleAgg).execute().actionGet();
assertSearchResponse(response);
Sampler sample = response.getAggregations().get("sample");
assertThat(sample.getDocCount(), greaterThan(0L));
Terms authors = sample.getAggregations().get("authors");
assertThat(authors.getBuckets().size(), greaterThan(0));
}
use of org.elasticsearch.search.aggregations.bucket.sampler.SamplerAggregationBuilder in project fess by codelibs.
the class BsDataConfigCA method sampler.
public void sampler(String name, ConditionOptionCall<SamplerAggregationBuilder> opLambda, OperatorCall<BsDataConfigCA> aggsLambda) {
SamplerAggregationBuilder builder = regSamplerA(name);
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
DataConfigCA ca = new DataConfigCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
use of org.elasticsearch.search.aggregations.bucket.sampler.SamplerAggregationBuilder in project fess by codelibs.
the class BsCrawlingInfoParamCA method sampler.
public void sampler(String name, ConditionOptionCall<SamplerAggregationBuilder> opLambda, OperatorCall<BsCrawlingInfoParamCA> aggsLambda) {
SamplerAggregationBuilder builder = regSamplerA(name);
if (opLambda != null) {
opLambda.callback(builder);
}
if (aggsLambda != null) {
CrawlingInfoParamCA ca = new CrawlingInfoParamCA();
aggsLambda.callback(ca);
ca.getAggregationBuilderList().forEach(builder::subAggregation);
}
}
Aggregations