ES 7.x fixes + bonus

* Fix `::Query->add_bool()` for stricter parser in ES 7.x
* Add `value_count` as a valid aggregation for sorting
This commit is contained in:
Brad Lhotsky 2021-09-16 15:57:37 -07:00
parent 963498bd7d
commit ff914b2e69
2 changed files with 2 additions and 2 deletions

View File

@ -629,7 +629,7 @@ sub add_bool {
## no critic
no strict 'refs';
my $set = $self->$section;
push @{ $set }, $bools{$section};
push @{ $set }, is_arrayref($bools{$section}) ? @{ $bools{$section} } : $bools{$section};
my $setter = "set_$section";
$self->$setter($set);
## use critic

View File

@ -209,7 +209,7 @@ foreach my $presence ( qw( exists missing ) ) {
}
}
my %SUPPORTED_AGGREGATIONS = map {$_=>'simple_value'} qw(cardinality sum min max avg);
my %SUPPORTED_AGGREGATIONS = map {$_=>'simple_value'} qw(cardinality sum min max avg value_count);
my $agg_header = '';
if( exists $OPT{top} ) {
my @top = split /:/, $OPT{top};