From e14c0451d496c3891a774eb8a76a82b64541e519 Mon Sep 17 00:00:00 2001 From: javanna Date: Tue, 27 Oct 2015 15:55:11 +0100 Subject: [PATCH] Remove support for edit_distance in completion suggester Replaced by fuzziness, consistent with other queries. --- .../search/suggest/completion/CompletionSuggestParser.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestParser.java b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestParser.java index 8470633fdc5..d5e4f7cf90d 100644 --- a/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestParser.java +++ b/core/src/main/java/org/elasticsearch/search/suggest/completion/CompletionSuggestParser.java @@ -19,7 +19,6 @@ package org.elasticsearch.search.suggest.completion; import org.elasticsearch.common.HasContextAndHeaders; -import org.elasticsearch.common.ParseField; import org.elasticsearch.common.bytes.BytesReference; import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.xcontent.XContentBuilder; @@ -43,7 +42,6 @@ import static org.elasticsearch.search.suggest.SuggestUtils.parseSuggestContext; public class CompletionSuggestParser implements SuggestContextParser { private CompletionSuggester completionSuggester; - private static final ParseField FUZZINESS = Fuzziness.FIELD.withDeprecation("edit_distance"); public CompletionSuggestParser(CompletionSuggester completionSuggester) { this.completionSuggester = completionSuggester; @@ -75,7 +73,7 @@ public class CompletionSuggestParser implements SuggestContextParser { if (token == XContentParser.Token.FIELD_NAME) { fuzzyConfigName = parser.currentName(); } else if (token.isValue()) { - if (queryParserService.parseFieldMatcher().match(fuzzyConfigName, FUZZINESS)) { + if (queryParserService.parseFieldMatcher().match(fuzzyConfigName, Fuzziness.FIELD)) { suggestion.setFuzzyEditDistance(Fuzziness.parse(parser).asDistance()); } else if ("transpositions".equals(fuzzyConfigName)) { suggestion.setFuzzyTranspositions(parser.booleanValue());