Skip to content

Apache Lucene open-source search software

Removing all deprecated TopScoreDocCollector + TopFieldCollector methods (#create, #createSharedManager) (#13617)

Jakub Slowinski74865bb92a59
diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt
index f749dc67d22..618f206ddec 100644
--- a/lucene/CHANGES.txt
+++ b/lucene/CHANGES.txt
@@ -246,6 +246,8 @@ Other
* GITHUB#13499: Remove usage of TopScoreDocCollector + TopFieldCollector deprecated methods (#create, #createSharedManager) (Jakub Slowinski)
+* GITHUB#13499: Removing all deprecated TopScoreDocCollector + TopFieldCollector methods (#create, #createSharedManager) (Jakub Slowinski)
+
======================== Lucene 9.12.0 =======================
API Changes
diff --git a/lucene/core/src/java/org/apache/lucene/search/TopFieldCollector.java b/lucene/core/src/java/org/apache/lucene/search/TopFieldCollector.java
index 1f4e840400f..7caf34c95f2 100644
--- a/lucene/core/src/java/org/apache/lucene/search/TopFieldCollector.java
+++ b/lucene/core/src/java/org/apache/lucene/search/TopFieldCollector.java
@@ -390,73 +390,6 @@ public abstract class TopFieldCollector extends TopDocsCollector<Entry> {
}
}
- /**
- * Creates a new {@link TopFieldCollector} from the given arguments.
- *
- * <p><b>NOTE</b>: The instances returned by this method pre-allocate a full array of length
- * <code>numHits</code>.
- *
- * @param sort the sort criteria (SortFields).
- * @param numHits the number of results to collect.
- * @param totalHitsThreshold the number of docs to count accurately. If the query matches more
- * than {@code totalHitsThreshold} hits then its hit count will be a lower bound. On the other
- * hand if the query matches less than or exactly {@code totalHitsThreshold} hits then the hit
- * count of the result will be accurate. {@link Integer#MAX_VALUE} may be used to make the hit
- * count accurate, but this will also make query processing slower.
- * @return a {@link TopFieldCollector} instance which will sort the results by the sort criteria.
- * @deprecated This method is deprecated in favor of the constructor of {@link
- * TopFieldCollectorManager} due to its support for concurrency in IndexSearcher
- */
- @Deprecated
- public static TopFieldCollector create(Sort sort, int numHits, int totalHitsThreshold) {
- return new TopFieldCollectorManager(sort, numHits, null, totalHitsThreshold, false)
- .newCollector();
- }
-
- /**
- * Creates a new {@link TopFieldCollector} from the given arguments.
- *
- * <p><b>NOTE</b>: The instances returned by this method pre-allocate a full array of length
- * <code>numHits</code>.
- *
- * @param sort the sort criteria (SortFields).
- * @param numHits the number of results to collect.
- * @param after only hits after this FieldDoc will be collected
- * @param totalHitsThreshold the number of docs to count accurately. If the query matches more
- * than {@code totalHitsThreshold} hits then its hit count will be a lower bound. On the other
- * hand if the query matches less than or exactly {@code totalHitsThreshold} hits then the hit
- * count of the result will be accurate. {@link Integer#MAX_VALUE} may be used to make the hit
- * count accurate, but this will also make query processing slower. Setting totalHitsThreshold
- * less than {@link Integer#MAX_VALUE} instructs Lucene to skip non-competitive documents
- * whenever possible. For numeric sort fields the skipping functionality works when the same
- * field is indexed both with doc values and points. In this case, there is an assumption that
- * the same data is stored in these points and doc values.
- * @return a {@link TopFieldCollector} instance which will sort the results by the sort criteria.
- * @deprecated This method is deprecated in favor of the constructor of {@link
- * TopFieldCollectorManager} due to its support for concurrency in IndexSearcher
- */
- @Deprecated
- public static TopFieldCollector create(
- Sort sort, int numHits, FieldDoc after, int totalHitsThreshold) {
- return new TopFieldCollectorManager(sort, numHits, after, totalHitsThreshold, false)
- .newCollector();
- }
-
- /**
- * Create a CollectorManager which uses a shared hit counter to maintain number of hits and a
- * shared {@link MaxScoreAccumulator} to propagate the minimum score accross segments if the
- * primary sort is by relevancy.
- *
- * @deprecated This method is deprecated in favor of the constructor of {@link
- * TopFieldCollectorManager} due to its support for concurrency in IndexSearcher
- */
- @Deprecated
- public static CollectorManager<TopFieldCollector, TopFieldDocs> createSharedManager(
- Sort sort, int numHits, FieldDoc after, int totalHitsThreshold) {
-
- return new TopFieldCollectorManager(sort, numHits, after, totalHitsThreshold, true);
- }
-
/**
* Populate {@link ScoreDoc#score scores} of the given {@code topDocs}.
*
diff --git a/lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollector.java b/lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollector.java
index 304eff2f11a..f74f087b7d5 100644
--- a/lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollector.java
+++ b/lucene/core/src/java/org/apache/lucene/search/TopScoreDocCollector.java
@@ -191,62 +191,6 @@ public abstract class TopScoreDocCollector extends TopDocsCollector<ScoreDoc> {
}
}
- /**
- * Creates a new {@link TopScoreDocCollector} given the number of hits to collect and the number
- * of hits to count accurately.
- *
- * <p><b>NOTE</b>: If the total hit count of the top docs is less than or exactly {@code
- * totalHitsThreshold} then this value is accurate. On the other hand, if the {@link
- * TopDocs#totalHits} value is greater than {@code totalHitsThreshold} then its value is a lower
- * bound of the hit count. A value of {@link Integer#MAX_VALUE} will make the hit count accurate
- * but will also likely make query processing slower.
- *
- * <p><b>NOTE</b>: The instances returned by this method pre-allocate a full array of length
- * <code>numHits</code>, and fill the array with sentinel objects.
- *
- * @deprecated This method is deprecated in favor of the constructor of {@link
- * TopScoreDocCollectorManager} due to its support for concurrency in IndexSearcher
- */
- @Deprecated
- public static TopScoreDocCollector create(int numHits, int totalHitsThreshold) {
- return new TopScoreDocCollectorManager(numHits, null, totalHitsThreshold, false).newCollector();
- }
-
- /**
- * Creates a new {@link TopScoreDocCollector} given the number of hits to collect, the bottom of
- * the previous page, and the number of hits to count accurately.
- *
- * <p><b>NOTE</b>: If the total hit count of the top docs is less than or exactly {@code
- * totalHitsThreshold} then this value is accurate. On the other hand, if the {@link
- * TopDocs#totalHits} value is greater than {@code totalHitsThreshold} then its value is a lower
- * bound of the hit count. A value of {@link Integer#MAX_VALUE} will make the hit count accurate
- * but will also likely make query processing slower.
- *
- * <p><b>NOTE</b>: The instances returned by this method pre-allocate a full array of length
- * <code>numHits</code>, and fill the array with sentinel objects.
- *
- * @deprecated This method is deprecated in favor of the constructor of {@link
- * TopScoreDocCollectorManager} due to its support for concurrency in IndexSearcher
- */
- @Deprecated
- public static TopScoreDocCollector create(int numHits, ScoreDoc after, int totalHitsThreshold) {
- return new TopScoreDocCollectorManager(numHits, after, totalHitsThreshold, false)
- .newCollector();
- }
-
- /**
- * Create a CollectorManager which uses a shared hit counter to maintain number of hits and a
- * shared {@link MaxScoreAccumulator} to propagate the minimum score accross segments
- *
- * @deprecated This method is deprecated in favor of the constructor of {@link
- * TopScoreDocCollectorManager} due to its support for concurrency in IndexSearcher
- */
- @Deprecated
- public static CollectorManager<TopScoreDocCollector, TopDocs> createSharedManager(
- int numHits, ScoreDoc after, int totalHitsThreshold) {
- return new TopScoreDocCollectorManager(numHits, after, totalHitsThreshold, true);
- }
-
int docBase;
ScoreDoc pqTop;
final HitsThresholdChecker hitsThresholdChecker;