Skip to content

Commit

Permalink
fix favorites count in search results
Browse files Browse the repository at this point in the history
  • Loading branch information
haarg committed Dec 27, 2017
1 parent 1cdd80d commit c287ed4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/MetaCPAN/Model/Search.pm
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,10 @@ sub _extract_results_add_favs {
+{
%{ $res->{fields} },
%{ $res->{_source} },
abstract => delete $res->{fields}->{'abstract.analyzed'},
score => $res->{_score},
favorites => $favorites->{ $res->{fields}->{distribution} },
abstract => delete $res->{fields}->{'abstract.analyzed'},
score => $res->{_score},
favorites =>
$favorites->{favorites}{ $res->{fields}->{distribution} },
}
} @{ $es_results->{hits}{hits} }
];
Expand Down

0 comments on commit c287ed4

Please sign in to comment.