Skip to content

Commit

Permalink
Add support for sorting "empty results"
Browse files Browse the repository at this point in the history
Added unmapped_type to the sort options, or else ES returns an error if no results are found or the sorting option is unset on some of the results.
  • Loading branch information
tannyl authored and damonsson committed Sep 27, 2019
1 parent 8e1d784 commit 7ff0724
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function retrieveData(array $requestData): array
$orderBy = $this->channelPricingNameResolver->resolvePropertyName($channelCode);
}

$data['sort'] = [$orderBy => ['order' => strtolower($sort)]];
$data['sort'] = [$orderBy => ['order' => strtolower($sort), 'unmapped_type' => 'keyword']];

return $data;
}
Expand Down

0 comments on commit 7ff0724

Please sign in to comment.