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


##########
lucene/suggest/src/test/org/apache/lucene/search/suggest/document/TestSuggestField.java:
##########
@@ -951,7 +951,16 @@ static IndexWriterConfig iwcWithSuggestField(Analyzer 
analyzer, final Set<String
         new FilterCodec(TestUtil.getDefaultCodec().getName(), 
TestUtil.getDefaultCodec()) {
           final CompletionPostingsFormat.FSTLoadMode fstLoadMode =
               RandomPicks.randomFrom(random(), 
CompletionPostingsFormat.FSTLoadMode.values());
-          final PostingsFormat postingsFormat = new 
Completion101PostingsFormat(fstLoadMode);
+          // FST load mode can only be overridden via a custom completion 
postings format
+          final PostingsFormat postingsFormat =
+              new CompletionPostingsFormat("Completion101", fstLoadMode) {
+                final CompletionPostingsFormat delegate = new 
Completion101PostingsFormat();
+
+                @Override
+                protected PostingsFormat delegatePostingsFormat() {
+                  return delegate.delegatePostingsFormat();
+                }
+              };

Review Comment:
   you are right, I tried to quickly hack this together and I ended up making 
the same mistake we already had in existing tests. Shame on me! I really do 
need to register the custom postings format to SPI for this to leverage the 
random fst load mode. I was also thinking about the option to remove 
configurability of fst load mode. That would certainly simplify things and 
avoid this same mistake in the future. Either that, or have a proper example of 
how the postings format load mode can be customized.



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