Skip to content

Commit

Permalink
Merge pull request #3000 from rbayet/fix-no-edge-ngram-at-query-time
Browse files Browse the repository at this point in the history
Prevent edge_ngram analyzer being used at query time
  • Loading branch information
rbayet authored Jul 7, 2023
2 parents 7500e70 + 2d0958a commit 48bc910
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/module-elasticsuite-core/Index/Mapping/Field.php
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,9 @@ private function getPropertyConfig($analyzer = self::ANALYZER_UNTOUCHED): array
}
if ($analyzer !== self::ANALYZER_UNTOUCHED) {
$fieldMapping['analyzer'] = $analyzer;
if ($analyzer === self::ANALYZER_EDGE_NGRAM) {
$fieldMapping['search_analyzer'] = self::ANALYZER_STANDARD;
}

if ($this->normsDisabled() || ($analyzer === self::ANALYZER_KEYWORD)) {
$fieldMapping['norms'] = false;
Expand Down

0 comments on commit 48bc910

Please sign in to comment.