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


##########
lucene/test-framework/src/java/org/apache/lucene/tests/analysis/MockTokenizer.java:
##########
@@ -66,11 +67,11 @@ public class MockTokenizer extends Tokenizer {
    * Limit the default token length to a size that doesn't cause random 
analyzer failures on
    * unpredictable data like the enwiki data set.
    *
-   * <p>This value defaults to {@code CharTokenizer.DEFAULT_MAX_WORD_LEN}.
+   * <p>This value defaults to {@link IndexWriter#MAX_TERM_LENGTH}.
    *
    * @see "https://issues.apache.org/jira/browse/LUCENE-10541";
    */
-  public static final int DEFAULT_MAX_TOKEN_LENGTH = 255;
+  public static final int DEFAULT_MAX_TOKEN_LENGTH = 
IndexWriter.MAX_TERM_LENGTH;

Review Comment:
   so yeah `IndexWriter.MAX_TERM_LENGTH/2` should be safe due to how this thing 
currently counts, just watch the off-by-one possibility. Maybe we can reproduce 
the original failure with the patch.
   
   Still I think MockTokenizer should have a default limit of something 
reasonable like 255 to prevent debugging other crazy tests. Sometimes stemmers 
make terms longer and stuff. Let's not set ourselves up for failure.
   



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