Skip to content

Commit 2e17cd6

Browse files
cpoerschkeepugh@opensourceconnections.com
authored andcommitted
SOLR-13138: deprecate LegacyBM25SimilarityFactory (apache#269)
1 parent 2c0667a commit 2e17cd6

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

solr/core/src/java/org/apache/solr/search/similarities/BM25SimilarityFactory.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
/**
2525
* Factory for BM25Similarity. This is the default similarity since 8.x.
2626
* If you need the exact same formula as in 6.x and 7.x you should instead look at
27-
* {@link LegacyBM25SimilarityFactory}
27+
* {@link LegacyBM25SimilarityFactory} noting that it is deprecated as of 8.10.0
28+
* and will be removed in 9.x.
2829
* <p>
2930
* Parameters:
3031
* <ul>

solr/core/src/java/org/apache/solr/search/similarities/LegacyBM25SimilarityFactory.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@
3838
* </ul>
3939
* @lucene.experimental
4040
* @since 8.0.0
41+
*
42+
* @deprecated {@link BM25SimilarityFactory} should be used instead
4143
*/
44+
@Deprecated
4245
public class LegacyBM25SimilarityFactory extends SimilarityFactory {
4346
private LegacyBM25Similarity similarity;
4447

solr/solr-ref-guide/src/schema-elements.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ One key exception to this is that you may explicitly declare a {solr-javadocs}/c
152152

153153
In the example above `IBSimilarityFactory` (using the Information-Based model) will be used for any fields of type `text_ib`, while `DFRSimilarityFactory` (divergence from random) will be used for any fields of type `text_dfr`, as well as any fields using a type that does not explicitly specify a `<similarity/>`.
154154

155-
If `SchemaSimilarityFactory` is explicitly declared without configuring a `defaultSimFromFieldType`, then `BM25Similarity` is implicitly used as the default for `luceneMatchVersion >= 8.0.0` and otherwise `LegacyBM25Similarity` is used to mimic the same BM25 formula that was the default in those versions.
155+
If `SchemaSimilarityFactory` is explicitly declared without configuring a `defaultSimFromFieldType`, then `BM25Similarity` is implicitly used as the default for `luceneMatchVersion >= 8.0.0` and otherwise the deprecated `LegacyBM25Similarity` (which will be removed in 9.x) is used to mimic the same BM25 formula that was the default in those versions.
156156

157-
In addition to the various factories mentioned on this page, there are several other similarity implementations that can be used such as the `SweetSpotSimilarityFactory`, `ClassicSimilarityFactory`, `LegacyBM25SimilarityFactory` etc.
157+
In addition to the various factories mentioned on this page, there are several other similarity implementations that can be used such as the `SweetSpotSimilarityFactory`, `ClassicSimilarityFactory` etc.
158158
For details, see the Solr Javadocs for the {solr-javadocs}/core/org/apache/solr/schema/SimilarityFactory.html[similarity factories].

0 commit comments

Comments
 (0)