analyzer might end up being null
This commit is contained in:
parent
e0c3bb5883
commit
1ec1716a7b
|
@ -114,7 +114,6 @@ public class MoreLikeThisFieldJsonQueryParser extends AbstractIndexComponent imp
|
|||
token = jp.nextToken();
|
||||
assert token == JsonToken.END_OBJECT;
|
||||
|
||||
mltQuery.setAnalyzer(parseContext.mapperService().searchAnalyzer());
|
||||
MapperService.SmartNameFieldMappers smartNameFieldMappers = parseContext.smartFieldMappers(fieldName);
|
||||
if (smartNameFieldMappers != null) {
|
||||
if (smartNameFieldMappers.hasMapper()) {
|
||||
|
@ -122,6 +121,9 @@ public class MoreLikeThisFieldJsonQueryParser extends AbstractIndexComponent imp
|
|||
mltQuery.setAnalyzer(smartNameFieldMappers.mapper().searchAnalyzer());
|
||||
}
|
||||
}
|
||||
if (mltQuery.getAnalyzer() == null) {
|
||||
mltQuery.setAnalyzer(parseContext.mapperService().searchAnalyzer());
|
||||
}
|
||||
mltQuery.setMoreLikeFields(new String[]{fieldName});
|
||||
return wrapSmartNameQuery(mltQuery, smartNameFieldMappers, parseContext.filterCache());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue