Skip to content

Commit

Permalink
query cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
mickeyn committed Apr 30, 2016
1 parent fc12b19 commit ca63dab
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
4 changes: 2 additions & 2 deletions lib/MetaCPAN/Script/Pagerank.pm
Expand Up @@ -29,7 +29,7 @@ sub run {
and => [
{
term => {
'release.dependency.phase' => 'runtime'
'dependency.phase' => 'runtime'
}
},
{ term => { status => 'latest' } },
Expand Down Expand Up @@ -87,7 +87,7 @@ sub get_recent_modules {
},
size => 1000,
fields => [
qw(release distribution file.module.authorized file.module.indexed file.module.name)
qw(release distribution module.authorized module.indexed module.name)
],
scroll => '1m',
);
Expand Down
7 changes: 3 additions & 4 deletions lib/MetaCPAN/Script/ReindexDist.pm
Expand Up @@ -34,10 +34,9 @@ has releases => (

sub _build_releases {
my ($self) = @_;
return [
$self->index->type('release')->filter(
{ term => { 'release.distribution' => $self->distribution } }
)->fields( [qw( download_url )] )->sort( ['date'] )->size(5000)
return [ $self->index->type('release')
->filter( { term => { distribution => $self->distribution } } )
->fields( [qw( download_url )] )->sort( ['date'] )->size(5000)
->all
];
}
Expand Down
4 changes: 2 additions & 2 deletions lib/MetaCPAN/Script/Watcher.pm
Expand Up @@ -205,13 +205,13 @@ sub reindex_release {
and => [
{
term => {
'file.release' =>
'release' =>
$release->{_source}->{name}
}
},
{
term => {
'file.author' =>
'author' =>
$release->{_source}->{author}
}
}
Expand Down
6 changes: 2 additions & 4 deletions lib/MetaCPAN/Server/Controller/Changes.pm
Expand Up @@ -47,7 +47,7 @@ sub get : Chained('index') : PathPart('') : Args(2) {
{ term => { distribution => 'perl' } },
{
term => {
'file.name' => 'perldelta.pod'
'name' => 'perldelta.pod'
}
},
]
Expand All @@ -61,9 +61,7 @@ sub get : Chained('index') : PathPart('') : Args(2) {
{
or => [
map {
{ term =>
{ 'file.name' => $_ }
}
{ term => { 'name' => $_ } }
} @candidates
]
}
Expand Down

0 comments on commit ca63dab

Please sign in to comment.