javanna commented on code in PR #16984:
URL: https://github.com/apache/lucene/pull/16984#discussion_r4482890420


##########
lucene/analysis/common/src/test/org/apache/lucene/analysis/miscellaneous/TestTruncateTokenFilterFactory.java:
##########
@@ -28,7 +28,6 @@ public class TestTruncateTokenFilterFactory extends 
BaseTokenStreamFactoryTestCa
 
   public void testCharTruncating() throws Exception {
     testCharTruncating(TruncateTokenFilterFactory.TRUNCATE_AFTER_CHARS_KEY);
-    testCharTruncating(TruncateTokenFilterFactory.PREFIX_LENGTH_KEY);

Review Comment:
   Shall we test that prefixLength is rejected for instance in 
testBogusArguments?



##########
lucene/MIGRATE.md:
##########
@@ -28,6 +28,12 @@ with `VisitedSet.create(expectedVisitedNodes, graphSize)`.
 
 ## Migration from Lucene 10.x to Lucene 11.0
 
+### TruncateTokenFilter constructor replaced by static factory methods 
(GITHUB#16984)
+
+The constructor `TruncateTokenFilter(TokenStream, int)` has been removed. To 
accomplish
+the same functionality use the static factory methods `truncateAfterChars` or 
`truncateAfterCodePoints`.
+Use the first as replacement of the existing behavior, but the second is 
unicode conformant.

Review Comment:
   Also add 
   
   > The factory parameter `prefixLength` has also been removed. Replace it 
with `truncateAfterChars`
     or `truncateAfterCodePoints` on `TruncateTokenFilterFactory` 



##########
lucene/MIGRATE.md:
##########
@@ -28,6 +28,12 @@ with `VisitedSet.create(expectedVisitedNodes, graphSize)`.
 
 ## Migration from Lucene 10.x to Lucene 11.0
 
+### TruncateTokenFilter constructor replaced by static factory methods 
(GITHUB#16984)
+
+The constructor `TruncateTokenFilter(TokenStream, int)` has been removed. To 
accomplish
+the same functionality use the static factory methods `truncateAfterChars` or 
`truncateAfterCodePoints`.
+Use the first as replacement of the existing behavior, but the second is 
unicode conformant.

Review Comment:
   Should we clarify this last sentence? 
   
   > truncateAfterChars keeps the old char-length behavior; 
truncateAfterCodePoints is the Unicode-correct replacement.



##########
lucene/analysis/common/src/java/org/apache/lucene/analysis/miscellaneous/TruncateTokenFilterFactory.java:
##########
@@ -59,7 +59,6 @@ public class TruncateTokenFilterFactory extends 
TokenFilterFactory {
   /** SPI name */
   public static final String NAME = "truncate";

Review Comment:
   I believe up above here we need to adjust javadocs as well?



##########
lucene/CHANGES.txt:
##########
@@ -37,6 +37,10 @@ Other
 
 API Changes
 ---------------------
+* GITHUB#16984: Remove the deprecated constructor in TruncateTokenFilter.
+  Its usage has been replaced by static factory methods 
TruncateTokenFilter.truncateAfterChars
+  for backward compatibility or TruncateTokenFilter.truncateAfterCodePoints. 
(Andrea Selva)

Review Comment:
   Should we also add:
   
   > The deprecated factory parameter prefixLength (PREFIX_LENGTH_KEY) is also 
removed;
       use truncateAfterChars or truncateAfterCodePoints instead. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to