Permalink
Browse files

When using script_fields, need to specify fields=>['_source'] otherwi…

…se it just returns the script field
  • Loading branch information...
1 parent edb169f commit 03349a58f77533f6fcdd0540a6a09910e5509a05 Clinton Gormley committed May 11, 2011
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/ElasticSearchX/Autocomplete/Type.pm
@@ -214,6 +214,7 @@ sub _retrieve_suggestions {
my $filter = @filters > 1 ? { and => \@filters } : $filters[0];
my $search = {
+ fields => ['_source'],
query => {
custom_score => {
query => {
@@ -293,6 +294,7 @@ sub _retrieve_popular {
my $filter = @filters > 1 ? { and => \@filters } : $filters[0];
return {
+ fields => ['_source'],
query => { constant_score => { filter => $filter } },
sort => [ { rank => 'desc' }, { label => 'asc' } ],
};

0 comments on commit 03349a5

Please sign in to comment.