Skip to content

Commit

Permalink
Corrected permission query
Browse files Browse the repository at this point in the history
Not sure why the terms query doesn't work properly, I suspect
an Elasticsearch bug.
  • Loading branch information
mickeyn committed Jun 6, 2017
1 parent ebf2d18 commit 8671d3e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/MetaCPAN/Document/Permission.pm
Expand Up @@ -69,9 +69,11 @@ sub by_modules {
my ( $self, $modules ) = @_;
$modules = [$modules] unless is_arrayref($modules);

my @modules = map +{ term => { module_name => $_ } }, @{$modules};

my $body = {
query => {
terms => { module_name => $modules },
bool => { should => \@modules }
},
size => 1_000,
};
Expand Down

0 comments on commit 8671d3e

Please sign in to comment.