From 2d0958a4d84fd2f172197a2d3ab589e0be645854 Mon Sep 17 00:00:00 2001 From: Richard BAYET Date: Thu, 6 Jul 2023 17:19:54 +0200 Subject: [PATCH] Prevent edge_ngram analyzer being used at query time --- src/module-elasticsuite-core/Index/Mapping/Field.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/module-elasticsuite-core/Index/Mapping/Field.php b/src/module-elasticsuite-core/Index/Mapping/Field.php index 9a817f1e1..170733011 100644 --- a/src/module-elasticsuite-core/Index/Mapping/Field.php +++ b/src/module-elasticsuite-core/Index/Mapping/Field.php @@ -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;