From e905312abcd2abb6c2f3ec04c6f782b34f2b75de Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Thu, 13 Sep 2012 19:02:24 +0000 Subject: [PATCH] improve fuzzyquery javadocs git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1384473 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/java/org/apache/lucene/search/FuzzyQuery.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lucene/core/src/java/org/apache/lucene/search/FuzzyQuery.java b/lucene/core/src/java/org/apache/lucene/search/FuzzyQuery.java index c849045804a..eb4fd38b972 100644 --- a/lucene/core/src/java/org/apache/lucene/search/FuzzyQuery.java +++ b/lucene/core/src/java/org/apache/lucene/search/FuzzyQuery.java @@ -28,12 +28,21 @@ import org.apache.lucene.util.ToStringUtils; import org.apache.lucene.util.automaton.LevenshteinAutomata; /** Implements the fuzzy search query. The similarity measurement - * is based on the Damerau-Levenshtein (optimal string alignment) algorithm. + * is based on the Damerau-Levenshtein (optimal string alignment) algorithm, + * though you can explicitly choose classic Levenshtein by passing false + * to the transpositions parameter. * *

This query uses {@link MultiTermQuery.TopTermsScoringBooleanQueryRewrite} * as default. So terms will be collected and scored according to their * edit distance. Only the top terms are used for building the {@link BooleanQuery}. * It is not recommended to change the rewrite mode for fuzzy queries. + * + *

At most, this query will match terms up to + * {@value org.apache.lucene.util.automaton.LevenshteinAutomata#MAXIMUM_SUPPORTED_DISTANCE} edits. + * Higher distances (especially with transpositions enabled), are generally not useful and + * will match a significant amount of the term dictionary. If you really want this, consider + * using an n-gram indexing technique (such as the SpellChecker in the + * suggest module) instead. */ public class FuzzyQuery extends MultiTermQuery {