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 18:39:40 UTC

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

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



##########
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:
       Why do we need a builder? Why not just only add `RewriteMethod` parameter to  the "full ctor". Don't add any more "sugar" ctors, we already have enough. This change currently wants to add something like 4 but none are necessary.




-- 
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