Skip to content

Commit

Permalink
Fix mapping of sortable only fields.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurélien FOUCRET committed Jan 4, 2017
1 parent 26104c9 commit 34fc3ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/module-elasticsuite-core/Index/Mapping/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -287,11 +287,11 @@ private function getFieldAnalyzers()
{
$analyzers = [];

if ($this->isSearchable()) {
if ($this->isSearchable() || $this->isUsedForSortBy()) {
// Default search analyzer.
$analyzers = [self::ANALYZER_STANDARD];

if ($this->getSearchWeight() > 1) {
if ($this->isSearchable() && $this->getSearchWeight() > 1) {
$analyzers[] = self::ANALYZER_WHITESPACE;
$analyzers[] = self::ANALYZER_SHINGLE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
/**
* Prepare a fulltext search query.
*
* @SuppressWarnings(PHPMD.ExcessiveClassComplexity)
*
* @category Smile
* @package Smile\ElasticsuiteCore
* @author Aurelien FOUCRET <aurelien.foucret@smile.fr>
Expand Down

0 comments on commit 34fc3ce

Please sign in to comment.