|
@@ -28,6 +28,8 @@ import org.elasticsearch.common.ParsingException;
|
|
|
import org.elasticsearch.common.Strings;
|
|
|
import org.elasticsearch.common.io.stream.StreamInput;
|
|
|
import org.elasticsearch.common.io.stream.StreamOutput;
|
|
|
+import org.elasticsearch.common.logging.DeprecationLogger;
|
|
|
+import org.elasticsearch.common.logging.Loggers;
|
|
|
import org.elasticsearch.common.lucene.BytesRefs;
|
|
|
import org.elasticsearch.common.unit.Fuzziness;
|
|
|
import org.elasticsearch.common.xcontent.XContentBuilder;
|
|
@@ -49,6 +51,8 @@ import java.util.Optional;
|
|
|
public class FuzzyQueryBuilder extends AbstractQueryBuilder<FuzzyQueryBuilder> implements MultiTermQueryBuilder {
|
|
|
public static final String NAME = "fuzzy";
|
|
|
|
|
|
+ private static final DeprecationLogger DEPRECATION_LOGGER = new DeprecationLogger(Loggers.getLogger(FuzzyQueryBuilder.class));
|
|
|
+
|
|
|
/** Default maximum edit distance. Defaults to AUTO. */
|
|
|
public static final Fuzziness DEFAULT_FUZZINESS = Fuzziness.AUTO;
|
|
|
|
|
@@ -151,6 +155,7 @@ public class FuzzyQueryBuilder extends AbstractQueryBuilder<FuzzyQueryBuilder> i
|
|
|
* @param value The value of the term
|
|
|
*/
|
|
|
public FuzzyQueryBuilder(String fieldName, Object value) {
|
|
|
+ DEPRECATION_LOGGER.deprecated("{} query is deprecated. Instead use the [match] query with fuzziness parameter", NAME);
|
|
|
if (Strings.isEmpty(fieldName)) {
|
|
|
throw new IllegalArgumentException("field name cannot be null or empty");
|
|
|
}
|