You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2022/03/02 15:11:09 UTC

[GitHub] [lucene] jpountz commented on a change in pull request #722: LUCENE-10431: Deprecate MultiTermQuery.setRewriteMethod()

jpountz commented on a change in pull request #722:
URL: https://github.com/apache/lucene/pull/722#discussion_r817784359



##########
File path: lucene/core/src/java/org/apache/lucene/search/FuzzyQuery.java
##########
@@ -56,6 +56,10 @@
   public static final int defaultMaxExpansions = 50;
   public static final boolean defaultTranspositions = true;
 
+  public static RewriteMethod defaultRewriteMethod(int maxExpansions) {

Review comment:
       Let's add javadocs?

##########
File path: lucene/core/src/java/org/apache/lucene/search/FuzzyQuery.java
##########
@@ -113,11 +138,40 @@ public FuzzyQuery(Term term, int maxEdits) {
     this(term, maxEdits, defaultPrefixLength);
   }
 
+  /**
+   * Calls {@link #FuzzyQuery(Term, int, int, int, boolean,
+   * org.apache.lucene.search.MultiTermQuery.RewriteMethod) FuzzyQuery(term, maxEdits,
+   * defaultPrefixLength, defaultMaxExpansions, defaultTransitions, defaultRewriteMethod)}.
+   */
+  public FuzzyQuery(Term term, int maxEdits, RewriteMethod rewriteMethod) {
+    this(
+        term,
+        maxEdits,
+        defaultPrefixLength,
+        defaultMaxExpansions,
+        defaultTranspositions,
+        rewriteMethod);
+  }
+
   /** Calls {@link #FuzzyQuery(Term, int) FuzzyQuery(term, defaultMaxEdits)}. */
   public FuzzyQuery(Term term) {
     this(term, defaultMaxEdits);
   }
 
+  /**
+   * Creates a new FuzzyQuery with default max edits, prefix length, max expansions and
+   * transpositions
+   */
+  public FuzzyQuery(Term term, RewriteMethod rewriteMethod) {
+    this(
+        term,
+        defaultMaxEdits,
+        defaultPrefixLength,
+        defaultMaxExpansions,
+        defaultTranspositions,
+        rewriteMethod);
+  }

Review comment:
       I wonder if we should add a builder to avoid the explosion of the number of ctors.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org