[ 
https://issues.apache.org/jira/browse/LUCENE-8141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16344935#comment-16344935
 ] 

Alan Woodward commented on LUCENE-8141:
---------------------------------------

Hi Matthias,

You can have as many different PostingsFormat implementations listed in the 
services files as you want.  Different Codecs can use different postings 
formats for different fields - in this case, the Completion50PostingsFormat is 
optimized for fields specifically used for suggestions, and there's a test in 
TestSuggestField that shows how to override a Codec to use it.

The default Codec just uses the Lucene50PostingsFormat, calling 
PostingsFormat.forName("Lucene50") when it needs to instantiate it.

> Inconsistent org.apache.lucene.codecs.PostingsFormat service definition?
> ------------------------------------------------------------------------
>
>                 Key: LUCENE-8141
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8141
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: core/codecs
>    Affects Versions: 7.2.1
>            Reporter: Matthias Gärtner
>            Priority: Minor
>
> I have a doubt about a seeming inconsistency w.r.t. to a service definition 
> in the distribution JAR files:
>  
> "lucene-suggest-7.2.1.jar" contains 
> "org.apache.lucene.search.suggest.document.*Completion50PostingsFormat*" 
> under "/META-INF/services/org.apache.lucene.codecs.PostingsFormat" (and BTW 
> _two copies_ of the license in that file?).
>  
> "lucene-core-7.2.1.jar" contains 
> "org.apache.lucene.codecs.lucene50.*Lucene50PostingsFormat*" under 
> "/META-INF/services/org.apache.lucene.codecs.PostingsFormat"
>  
> Apparently, it depends on the classpath order on the client side which 
> implementation is used. Is it *intentional* that there are two unequal 
> definitions in the same release?
>  
> Note: I've observed this because of some Jar Hell checker output, not because 
> there's an actual malfunction that I'm aware of.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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

Reply via email to