rmuir commented on code in PR #13757:
URL: https://github.com/apache/lucene/pull/13757#discussion_r1754464145


##########
lucene/core/src/java/org/apache/lucene/search/similarities/Similarity.java:
##########
@@ -88,9 +89,41 @@
  * @lucene.experimental
  */
 public abstract class Similarity {
-  /** Sole constructor. (For invocation by subclass constructors, typically 
implicit.) */
-  // Explicitly declared so that we have non-empty javadoc
-  protected Similarity() {}
+  /**
+   * True if overlap tokens (tokens with a position of increment of zero) are 
discounted from the
+   * document's length.
+   */
+  private boolean discountOverlaps = true;

Review Comment:
   Let's make this `final` (no need to set it to a value here as ctor always 
sets it) and remove the setter.
   
   Otherwise, the way you had it without a boolean (abstract 
`discountOverlaps`) looked fine too?
   
   But I think we shouldn't add mutability to the base Similarity class when 
setter is totally not needed by anyone.



-- 
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-unsubscr...@lucene.apache.org

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


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

Reply via email to