uschindler commented on issue #12501:
URL: https://github.com/apache/lucene/issues/12501#issuecomment-1674996502

   > The postings format classes are `final`. Besides having two 
implementations (`Lucene84PostingsFormat` in lucene-core and 
`MyLucene84PostingsFormat`) with the same "Lucene84" name will likely result in 
a lookup error?
   
   Exactly and because of that its final. Your postings format needs a new name.
   
   If you want to use it as default you can subclass the `Codec` as this is the 
main entry point: 
https://github.com/apache/lucene/blob/df8745e59ee65f276ccaefa87480e1fd85facb56/lucene/core/src/java/org/apache/lucene/codecs/lucene95/Lucene95Codec.java#L55
   
   I don't understand what your problem is:
   - Write your own postings format with its own name. You can't subclass. But 
you can use a FilterPostingsFormat to wrap the default postings format
   - Subclass 
https://github.com/apache/lucene/blob/df8745e59ee65f276ccaefa87480e1fd85facb56/lucene/core/src/java/org/apache/lucene/codecs/lucene95/Lucene95Codec.java#L55
 and return/inject your codec there, an alternative which is not so statically 
depending on the exact version is to use `new FilterCodec(Codec.getDefault()) { 
... override method returning postingsFormat()... }`


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