Skip to content

Commit

Permalink
try different queries for meta data fetching
Browse files Browse the repository at this point in the history
  • Loading branch information
ranguard committed May 12, 2017
1 parent d39fb41 commit f4972f8
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions lib/MetaCPAN/Model/Search.pm
Expand Up @@ -202,7 +202,7 @@ sub _search_collapsed {
bool => {
should => {
terms => {
distribution => [@distributions],
distribution => \@distributions,
}
}
}
Expand Down Expand Up @@ -326,9 +326,12 @@ sub _build_search_descriptions_query {
my ( $self, @ids ) = @_;
my $es_query = {
query => {
filtered => {
query => { match_all => {} },
filter => { or => [ map { { term => { id => $_ } } } @ids ] }
bool => {
should => {
terms => {
id => \@ids,
}
}
}
},
fields => [qw(description id)],
Expand Down Expand Up @@ -361,13 +364,11 @@ sub _build_search_favorites_query {
my $es_query = {
size => 0,
query => {
filtered => {
query => { match_all => {} },
filter => {
or => [
map { { term => { 'distribution' => $_ } } }
@distributions
]
bool => {
should => {
terms => {
distribution => \@distributions,
}
}
}
},
Expand Down

0 comments on commit f4972f8

Please sign in to comment.