Skip to content

Commit 72d66fc

Browse files
committed
check: ES syntax update for newer versions
1 parent 542f3ec commit 72d66fc

File tree

1 file changed

+21
-18
lines changed

1 file changed

+21
-18
lines changed

bin/check.pl

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@
4242
fields => [
4343
qw< name release author distribution version authorized indexed maturity date >
4444
],
45-
query => { match_all => {} },
46-
filter => {
47-
and => [
48-
{ term => { 'module.name' => $pkg } },
49-
{ term => { authorized => 'true' } },
50-
{ term => { maturity => 'released' } },
51-
],
45+
query => {
46+
bool => {
47+
must => [
48+
{ term => { 'module.name' => $pkg } },
49+
{ term => { authorized => 'true' } },
50+
{ term => { maturity => 'released' } },
51+
],
52+
},
5253
},
5354
);
5455
my @files = @{ $results->{hits}{hits} };
@@ -58,12 +59,13 @@
5859
my $release_results = $es_release->search(
5960
size => 1,
6061
fields => [qw< name status authorized version id date >],
61-
query => { match_all => {} },
62-
filter => {
63-
and => [
64-
{ term => { name => $file->{fields}{release} } },
65-
{ term => { status => 'latest' } },
66-
],
62+
query => {
63+
bool => {
64+
must => [
65+
{ term => { name => $file->{fields}{release} } },
66+
{ term => { status => 'latest' } },
67+
],
68+
},
6769
},
6870
);
6971

@@ -79,11 +81,12 @@
7981
size => 1,
8082
fields =>
8183
[qw< name status authorized version id date >],
82-
query => { match_all => {} },
83-
filter => {
84-
and => [ {
85-
term => { name => $file->{fields}{release} }
86-
} ]
84+
query => {
85+
bool => {
86+
must => [
87+
{ term => { name => $file->{fields}{release} } },
88+
],
89+
},
8790
},
8891
);
8992

0 commit comments

Comments
 (0)