File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
src/main/java/org/nlpcn/es4sql/query/maker Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -462,7 +462,8 @@ private AbstractAggregationBuilder makeCountAgg(MethodField field) {
462
462
463
463
// Cardinality is approximate DISTINCT.
464
464
if ("DISTINCT" .equals (field .getOption ())) {
465
- return AggregationBuilders .cardinality (field .getAlias ()).precisionThreshold (40000 ).field (field .getParams ().get (0 ).value .toString ());
465
+ Integer precision_threshold = field .getParams ().size ()>1 ? (Integer )(field .getParams ().get (1 ).value ) : 40000 ;
466
+ return AggregationBuilders .cardinality (field .getAlias ()).precisionThreshold (precision_threshold ).field (field .getParams ().get (0 ).value .toString ());
466
467
}
467
468
468
469
String fieldName = field .getParams ().get (0 ).value .toString ();
You can’t perform that action at this time.
0 commit comments