@@ -70,10 +70,17 @@ public class SignificantTermsAggregatorFactory extends ValuesSourceAggregatorFac
70
70
private final TermsAggregator .BucketCountThresholds bucketCountThresholds ;
71
71
private final SignificanceHeuristic significanceHeuristic ;
72
72
73
- public SignificantTermsAggregatorFactory (String name , ValuesSourceConfig <ValuesSource > config , IncludeExclude includeExclude ,
74
- String executionHint , QueryBuilder filterBuilder , TermsAggregator .BucketCountThresholds bucketCountThresholds ,
75
- SignificanceHeuristic significanceHeuristic , SearchContext context , AggregatorFactory <?> parent ,
76
- AggregatorFactories .Builder subFactoriesBuilder , Map <String , Object > metaData ) throws IOException {
73
+ public SignificantTermsAggregatorFactory (String name ,
74
+ ValuesSourceConfig <ValuesSource > config ,
75
+ IncludeExclude includeExclude ,
76
+ String executionHint ,
77
+ QueryBuilder filterBuilder ,
78
+ TermsAggregator .BucketCountThresholds bucketCountThresholds ,
79
+ SignificanceHeuristic significanceHeuristic ,
80
+ SearchContext context ,
81
+ AggregatorFactory <?> parent ,
82
+ AggregatorFactories .Builder subFactoriesBuilder ,
83
+ Map <String , Object > metaData ) throws IOException {
77
84
super (name , config , context , parent , subFactoriesBuilder , metaData );
78
85
this .includeExclude = includeExclude ;
79
86
this .executionHint = executionHint ;
@@ -246,44 +253,71 @@ public enum ExecutionMode {
246
253
MAP (new ParseField ("map" )) {
247
254
248
255
@ Override
249
- Aggregator create (String name , AggregatorFactories factories , ValuesSource valuesSource , DocValueFormat format ,
250
- TermsAggregator .BucketCountThresholds bucketCountThresholds , IncludeExclude includeExclude ,
251
- SearchContext aggregationContext , Aggregator parent , SignificanceHeuristic significanceHeuristic ,
252
- SignificantTermsAggregatorFactory termsAggregatorFactory , List <PipelineAggregator > pipelineAggregators ,
253
- Map <String , Object > metaData ) throws IOException {
256
+ Aggregator create (String name ,
257
+ AggregatorFactories factories ,
258
+ ValuesSource valuesSource ,
259
+ DocValueFormat format ,
260
+ TermsAggregator .BucketCountThresholds bucketCountThresholds ,
261
+ IncludeExclude includeExclude ,
262
+ SearchContext aggregationContext ,
263
+ Aggregator parent ,
264
+ SignificanceHeuristic significanceHeuristic ,
265
+ SignificantTermsAggregatorFactory termsAggregatorFactory ,
266
+ List <PipelineAggregator > pipelineAggregators ,
267
+ Map <String , Object > metaData ) throws IOException {
268
+
254
269
final IncludeExclude .StringFilter filter = includeExclude == null ? null : includeExclude .convertToStringFilter (format );
255
270
return new SignificantStringTermsAggregator (name , factories , valuesSource , format , bucketCountThresholds , filter ,
256
271
aggregationContext , parent , significanceHeuristic , termsAggregatorFactory , pipelineAggregators , metaData );
272
+
257
273
}
258
274
259
275
},
260
276
GLOBAL_ORDINALS (new ParseField ("global_ordinals" )) {
261
277
262
278
@ Override
263
- Aggregator create (String name , AggregatorFactories factories , ValuesSource valuesSource , DocValueFormat format ,
264
- TermsAggregator .BucketCountThresholds bucketCountThresholds , IncludeExclude includeExclude ,
265
- SearchContext aggregationContext , Aggregator parent , SignificanceHeuristic significanceHeuristic ,
266
- SignificantTermsAggregatorFactory termsAggregatorFactory , List <PipelineAggregator > pipelineAggregators ,
267
- Map <String , Object > metaData ) throws IOException {
279
+ Aggregator create (String name ,
280
+ AggregatorFactories factories ,
281
+ ValuesSource valuesSource ,
282
+ DocValueFormat format ,
283
+ TermsAggregator .BucketCountThresholds bucketCountThresholds ,
284
+ IncludeExclude includeExclude ,
285
+ SearchContext aggregationContext ,
286
+ Aggregator parent ,
287
+ SignificanceHeuristic significanceHeuristic ,
288
+ SignificantTermsAggregatorFactory termsAggregatorFactory ,
289
+ List <PipelineAggregator > pipelineAggregators ,
290
+ Map <String , Object > metaData ) throws IOException {
291
+
268
292
final IncludeExclude .OrdinalsFilter filter = includeExclude == null ? null : includeExclude .convertToOrdinalsFilter (format );
269
293
return new GlobalOrdinalsSignificantTermsAggregator (name , factories ,
270
294
(ValuesSource .Bytes .WithOrdinals .FieldData ) valuesSource , format , bucketCountThresholds , filter ,
271
- aggregationContext , parent , significanceHeuristic , termsAggregatorFactory , pipelineAggregators , metaData );
295
+ aggregationContext , parent , false , significanceHeuristic , termsAggregatorFactory , pipelineAggregators , metaData );
296
+
272
297
}
273
298
274
299
},
275
300
GLOBAL_ORDINALS_HASH (new ParseField ("global_ordinals_hash" )) {
276
301
277
302
@ Override
278
- Aggregator create (String name , AggregatorFactories factories , ValuesSource valuesSource , DocValueFormat format ,
279
- TermsAggregator .BucketCountThresholds bucketCountThresholds , IncludeExclude includeExclude ,
280
- SearchContext aggregationContext , Aggregator parent , SignificanceHeuristic significanceHeuristic ,
281
- SignificantTermsAggregatorFactory termsAggregatorFactory , List <PipelineAggregator > pipelineAggregators ,
282
- Map <String , Object > metaData ) throws IOException {
303
+ Aggregator create (String name ,
304
+ AggregatorFactories factories ,
305
+ ValuesSource valuesSource ,
306
+ DocValueFormat format ,
307
+ TermsAggregator .BucketCountThresholds bucketCountThresholds ,
308
+ IncludeExclude includeExclude ,
309
+ SearchContext aggregationContext ,
310
+ Aggregator parent ,
311
+ SignificanceHeuristic significanceHeuristic ,
312
+ SignificantTermsAggregatorFactory termsAggregatorFactory ,
313
+ List <PipelineAggregator > pipelineAggregators ,
314
+ Map <String , Object > metaData ) throws IOException {
315
+
283
316
final IncludeExclude .OrdinalsFilter filter = includeExclude == null ? null : includeExclude .convertToOrdinalsFilter (format );
284
- return new GlobalOrdinalsSignificantTermsAggregator .WithHash (name , factories ,
285
- (ValuesSource .Bytes .WithOrdinals .FieldData ) valuesSource , format , bucketCountThresholds , filter ,
286
- aggregationContext , parent , significanceHeuristic , termsAggregatorFactory , pipelineAggregators , metaData );
317
+ return new GlobalOrdinalsSignificantTermsAggregator (name , factories ,
318
+ (ValuesSource .Bytes .WithOrdinals .FieldData ) valuesSource , format , bucketCountThresholds , filter , aggregationContext , parent ,
319
+ true , significanceHeuristic , termsAggregatorFactory , pipelineAggregators , metaData );
320
+
287
321
}
288
322
};
289
323
@@ -302,11 +336,18 @@ public static ExecutionMode fromString(String value) {
302
336
this .parseField = parseField ;
303
337
}
304
338
305
- abstract Aggregator create (String name , AggregatorFactories factories , ValuesSource valuesSource , DocValueFormat format ,
306
- TermsAggregator .BucketCountThresholds bucketCountThresholds , IncludeExclude includeExclude ,
307
- SearchContext aggregationContext , Aggregator parent , SignificanceHeuristic significanceHeuristic ,
308
- SignificantTermsAggregatorFactory termsAggregatorFactory , List <PipelineAggregator > pipelineAggregators ,
309
- Map <String , Object > metaData ) throws IOException ;
339
+ abstract Aggregator create (String name ,
340
+ AggregatorFactories factories ,
341
+ ValuesSource valuesSource ,
342
+ DocValueFormat format ,
343
+ TermsAggregator .BucketCountThresholds bucketCountThresholds ,
344
+ IncludeExclude includeExclude ,
345
+ SearchContext aggregationContext ,
346
+ Aggregator parent ,
347
+ SignificanceHeuristic significanceHeuristic ,
348
+ SignificantTermsAggregatorFactory termsAggregatorFactory ,
349
+ List <PipelineAggregator > pipelineAggregators ,
350
+ Map <String , Object > metaData ) throws IOException ;
310
351
311
352
@ Override
312
353
public String toString () {
0 commit comments