apache / lucene

Apache Lucene open-source search software
https://lucene.apache.org/
Apache License 2.0
2.59k stars 1.01k forks source link

Inconsistent org.apache.lucene.codecs.PostingsFormat service definition? [LUCENE-8141] #9189

Open asfimport opened 6 years ago

asfimport commented 6 years ago

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.


Migrated from LUCENE-8141 by Matthias Gärtner (@m9aertner), updated Jan 31 2018

asfimport commented 6 years ago

Alan Woodward (@romseygeek) (migrated from JIRA)

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.

asfimport commented 6 years ago

ASF subversion and git services (migrated from JIRA)

Commit ebb346d58204d014f85fe3576ce00a0d000491bb in lucene-solr's branch refs/heads/master from @DaddyWri https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=ebb346d

LUCENE-8141: Do a better job of making sure polygon points are not coplanar. Committed on behalf of Ignacio Vera.

asfimport commented 6 years ago

ASF subversion and git services (migrated from JIRA)

Commit f419b96687b393989dc0bf25c327ca98498459e1 in lucene-solr's branch refs/heads/branch_6x from @DaddyWri https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=f419b96

LUCENE-8141: Do a better job of making sure polygon points are not coplanar. Committed on behalf of Ignacio Vera.

asfimport commented 6 years ago

ASF subversion and git services (migrated from JIRA)

Commit 505f7b9d56abed389f20d97a16bc5462603b95a3 in lucene-solr's branch refs/heads/branch_7x from @DaddyWri https://git-wip-us.apache.org/repos/asf?p=lucene-solr.git;h=505f7b9

LUCENE-8141: Do a better job of making sure polygon points are not coplanar. Committed on behalf of Ignacio Vera.