Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fix filter step
  • Loading branch information
ranguard committed May 12, 2017
1 parent 28ad351 commit d39fb41
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions lib/MetaCPAN/Model/Search.pm
Expand Up @@ -199,17 +199,11 @@ sub _search_collapsed {
# searching in $page_size=20 distributions max
size => 5000,
query => {
filtered => {
filter => {
and => [
{
or => [
map {
{ term => { 'distribution' => $_ } }
} @distributions
]
}
]
bool => {
should => {
terms => {
distribution => [@distributions],
}
}
}
}
Expand Down Expand Up @@ -258,7 +252,7 @@ sub build_query {
# ( my $clean = $search_term ) =~ s/::/ /g;
my $structure = decode_json $json;

my $multi_match = $structure->{query}->{bool}->{must} #
my $multi_match = $structure->{query}->{bool}->{must}->[0] #
->{function_score}->{query}->{function_score}->{query}->{boosting}
->{positive}->{multi_match};

Expand Down Expand Up @@ -453,7 +447,8 @@ __DATA__
{
"query": {
"bool": {
"must": {
"must": [
{
"function_score": {
"query": {
"function_score": {
Expand Down Expand Up @@ -487,7 +482,8 @@ __DATA__
}
}
}
},
}
],
"must_not": [
{
"terms": {
Expand Down

0 comments on commit d39fb41

Please sign in to comment.