Skip to content

Commit

Permalink
Update javadocs for QueryTimeout (#12272)
Browse files Browse the repository at this point in the history
QueryTimeout was introduced together with ExitableDirectoryReader but is
now also optionally set to the IndexSearcher to wrap the bulk scorer
with a TimeLimitingBulkScorer. Its javadocs needs updating.
  • Loading branch information
javanna committed May 9, 2023
1 parent 3e6ab76 commit 48986d1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lucene/core/src/java/org/apache/lucene/index/QueryTimeout.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,17 @@
package org.apache.lucene.index;

/**
* Base for query timeout implementations, which will provide a {@code shouldExit()} method, used
* with {@link ExitableDirectoryReader}.
* Query timeout abstraction that controls whether a query should continue or be stopped. Can be set
* to the searcher through {@link org.apache.lucene.search.IndexSearcher#setTimeout(QueryTimeout)},
* in which case bulk scoring will be time-bound. Can also be used in combination with {@link
* ExitableDirectoryReader}.
*/
public interface QueryTimeout {

/**
* Called from {@link ExitableDirectoryReader.ExitableTermsEnum#next()} to determine whether to
* stop processing a query.
* Called to determine whether to stop processing a query
*
* @return true if the query should stop, false otherwise
*/
public abstract boolean shouldExit();
boolean shouldExit();
}

0 comments on commit 48986d1

Please sign in to comment.