Remove support for min_similarity in fuzzy query

Replaced by fuzziness, consistent with other queries.
This commit is contained in:
javanna 2015-10-27 15:53:59 +01:00 committed by Luca Cavanna
parent b66318c3ec
commit 77511643ee
1 changed files with 2 additions and 4 deletions

View File

@ -19,16 +19,14 @@
package org.elasticsearch.index.query; package org.elasticsearch.index.query;
import org.elasticsearch.common.ParseField;
import org.elasticsearch.common.ParsingException; import org.elasticsearch.common.ParsingException;
import org.elasticsearch.common.unit.Fuzziness; import org.elasticsearch.common.unit.Fuzziness;
import org.elasticsearch.common.xcontent.XContentParser; import org.elasticsearch.common.xcontent.XContentParser;
import java.io.IOException; import java.io.IOException;
public class FuzzyQueryParser implements QueryParser<FuzzyQueryBuilder> { public class FuzzyQueryParser implements QueryParser<FuzzyQueryBuilder> {
private static final ParseField FUZZINESS = Fuzziness.FIELD.withDeprecation("min_similarity");
@Override @Override
public String[] names() { public String[] names() {
return new String[]{ FuzzyQueryBuilder.NAME }; return new String[]{ FuzzyQueryBuilder.NAME };
@ -68,7 +66,7 @@ public class FuzzyQueryParser implements QueryParser<FuzzyQueryBuilder> {
value = parser.objectBytes(); value = parser.objectBytes();
} else if ("boost".equals(currentFieldName)) { } else if ("boost".equals(currentFieldName)) {
boost = parser.floatValue(); boost = parser.floatValue();
} else if (parseContext.parseFieldMatcher().match(currentFieldName, FUZZINESS)) { } else if (parseContext.parseFieldMatcher().match(currentFieldName, Fuzziness.FIELD)) {
fuzziness = Fuzziness.parse(parser); fuzziness = Fuzziness.parse(parser);
} else if ("prefix_length".equals(currentFieldName) || "prefixLength".equals(currentFieldName)) { } else if ("prefix_length".equals(currentFieldName) || "prefixLength".equals(currentFieldName)) {
prefixLength = parser.intValue(); prefixLength = parser.intValue();