Skip to content

Commit

Permalink
ES 7.x fixes + bonus
Browse files Browse the repository at this point in the history
* Fix `::Query->add_bool()` for stricter parser in ES 7.x
* Add `value_count` as a valid aggregation for sorting
  • Loading branch information
reyjrar committed Sep 16, 2021
1 parent 963498b commit ff914b2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/App/ElasticSearch/Utilities/Query.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/es-search.pl
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@
}
}

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};
Expand Down

0 comments on commit ff914b2

Please sign in to comment.