From 036710342323b14315b7f683299324ab5f2d62b4 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Wed, 12 Oct 2011 22:14:03 +0200 Subject: [PATCH] Text Query does not use search_analyzer on field that is prefixed with the type name, closes #1390. --- .../java/org/elasticsearch/index/search/TextQueryParser.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/index/search/TextQueryParser.java b/modules/elasticsearch/src/main/java/org/elasticsearch/index/search/TextQueryParser.java index 415ff8f5510..d42a46b12f0 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/index/search/TextQueryParser.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/index/search/TextQueryParser.java @@ -130,6 +130,9 @@ public class TextQueryParser { if (mapper != null) { analyzer = mapper.searchAnalyzer(); } + if (analyzer == null && smartNameFieldMappers != null && smartNameFieldMappers.docMapper() != null) { + analyzer = smartNameFieldMappers.docMapper().searchAnalyzer(); + } if (analyzer == null) { analyzer = parseContext.mapperService().searchAnalyzer(); }