Query DSL: Fuzzy Like This, closes #103.
This commit is contained in:
parent
58d2e2e1fc
commit
408bad62f3
|
@ -118,7 +118,7 @@ public class FuzzyLikeThisFieldJsonQueryParser extends AbstractIndexComponent im
|
|||
throw new QueryParsingException(index, "fuzzyLikeThisField requires 'likeText' to be specified");
|
||||
}
|
||||
|
||||
Analyzer analyzer = parseContext.mapperService().searchAnalyzer();
|
||||
Analyzer analyzer = null;
|
||||
MapperService.SmartNameFieldMappers smartNameFieldMappers = parseContext.smartFieldMappers(fieldName);
|
||||
if (smartNameFieldMappers != null) {
|
||||
if (smartNameFieldMappers.hasMapper()) {
|
||||
|
@ -126,6 +126,9 @@ public class FuzzyLikeThisFieldJsonQueryParser extends AbstractIndexComponent im
|
|||
analyzer = smartNameFieldMappers.mapper().searchAnalyzer();
|
||||
}
|
||||
}
|
||||
if (analyzer == null) {
|
||||
analyzer = parseContext.mapperService().searchAnalyzer();
|
||||
}
|
||||
|
||||
FuzzyLikeThisQuery query = new FuzzyLikeThisQuery(maxNumTerms, analyzer);
|
||||
query.addTerms(likeText, fieldName, minSimilarity, prefixLength);
|
||||
|
|
Loading…
Reference in New Issue