prudhvigodithi commented on code in PR #16042:
URL: https://github.com/apache/lucene/pull/16042#discussion_r3209994501


##########
lucene/core/src/java/org/apache/lucene/search/TopFieldCollectorManager.java:
##########
@@ -182,6 +186,16 @@ public TopFieldDocs reduce(Collection<TopFieldCollector> 
collectors) throws IOEx
     return TopDocs.merge(sort, 0, numHits, topDocs);
   }
 
+  /**
+   * Returns the collectors created by this manager.
+   *
+   * @deprecated This method and internal collector tracking will be removed 
in Lucene 11. The
+   *     internal collector tracking is unnecessary since collectors are 
passed to {@link
+   *     #reduce(Collection)} by {@link IndexSearcher}. Users who need to 
track collectors (e.g.,
+   *     for early termination detection via {@link 
TopFieldCollector#isEarlyTerminated()}) should
+   *     maintain their own collection.

Review Comment:
   Got it, I have shortened it a bit based on your point, please check and let 
me know if that is fine.



##########
lucene/CHANGES.txt:
##########
@@ -23,6 +23,10 @@ API Changes
 * GITHUB#15584: Add support for termdoc fields that use custom term freqs (via 
IndexOptions.DOCS_AND_CUSTOM_FREQS).
   IndexWriter counts their terms rather than summing their freqs.  Use
 
+* GITHUB#15605: Deprecate getCollectors() in TopFieldCollectorManager. The 
internal collector
+  tracking is unnecessary and will be removed in Lucene 11. Clarify 
thread-safety

Review Comment:
   Your working make sense to me, updated in my latest commit.



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