Mark TimeLimitingCollector as deprecated (#13220)

Co-authored-by: Kaival Parikh <kaivalp2000@gmail.com>
This commit is contained in:
Kaival Parikh 2024-03-29 13:42:48 +05:30 committed by GitHub
parent 42a5ff6ace
commit 878d233bc1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 4 deletions

View File

@ -31,8 +31,6 @@ import org.apache.lucene.util.automaton.CompiledAutomaton;
* {@link QueryTimeout} implementation object to be checked periodically to see if the thread should * {@link QueryTimeout} implementation object to be checked periodically to see if the thread should
* exit or not. If {@link QueryTimeout#shouldExit()} returns true, an {@link ExitingReaderException} * exit or not. If {@link QueryTimeout#shouldExit()} returns true, an {@link ExitingReaderException}
* is thrown. * is thrown.
*
* @see org.apache.lucene.search.TimeLimitingCollector
*/ */
public class ExitableDirectoryReader extends FilterDirectoryReader { public class ExitableDirectoryReader extends FilterDirectoryReader {

View File

@ -37,8 +37,6 @@ import org.apache.lucene.index.LeafReaderContext;
* <li>{@link TopFieldCollector} subclasses {@link TopDocsCollector} and sorts according to a * <li>{@link TopFieldCollector} subclasses {@link TopDocsCollector} and sorts according to a
* specified {@link Sort} object (sort by field). This is used internally by the {@link * specified {@link Sort} object (sort by field). This is used internally by the {@link
* IndexSearcher} search methods that take an explicit {@link Sort}. * IndexSearcher} search methods that take an explicit {@link Sort}.
* <li>{@link TimeLimitingCollector}, which wraps any other Collector and aborts the search if
* it's taken too much time.
* <li>{@link PositiveScoresOnlyCollector} wraps any other Collector and prevents collection of * <li>{@link PositiveScoresOnlyCollector} wraps any other Collector and prevents collection of
* hits whose score is &lt;= 0.0 * hits whose score is &lt;= 0.0
* </ul> * </ul>

View File

@ -18,6 +18,7 @@ package org.apache.lucene.search;
import java.io.IOException; import java.io.IOException;
import org.apache.lucene.index.LeafReaderContext; import org.apache.lucene.index.LeafReaderContext;
import org.apache.lucene.index.QueryTimeout;
import org.apache.lucene.util.Counter; import org.apache.lucene.util.Counter;
import org.apache.lucene.util.SuppressForbidden; import org.apache.lucene.util.SuppressForbidden;
import org.apache.lucene.util.ThreadInterruptedException; import org.apache.lucene.util.ThreadInterruptedException;
@ -27,8 +28,10 @@ import org.apache.lucene.util.ThreadInterruptedException;
* maximum allowed search time limit. After this time is exceeded, the search thread is stopped by * maximum allowed search time limit. After this time is exceeded, the search thread is stopped by
* throwing a {@link TimeExceededException}. * throwing a {@link TimeExceededException}.
* *
* @deprecated Use {@link IndexSearcher#setTimeout(QueryTimeout)} to time out queries.
* @see org.apache.lucene.index.ExitableDirectoryReader * @see org.apache.lucene.index.ExitableDirectoryReader
*/ */
@Deprecated
public class TimeLimitingCollector implements Collector { public class TimeLimitingCollector implements Collector {
/** Thrown when elapsed search time exceeds allowed search time. */ /** Thrown when elapsed search time exceeds allowed search time. */