LUCENE-8811: Undo removal of deprecations.

This commit is contained in:
Adrien Grand 2019-07-15 11:19:58 +02:00
parent 26ede632e6
commit 607c46c997
2 changed files with 32 additions and 7 deletions
lucene
CHANGES.txt
core/src/java/org/apache/lucene/search

View File

@ -22,8 +22,10 @@ API Changes
byte[] that stores the UTF-8 bytes of the stored string.
(Namgyu Kim via Adrien Grand)
* LUCENE-8811: Deprecated BooleanQuery#setMaxClauseCount() and getMaxClauseCount
have been removed (Atri Sharma, Adrien Grand, Alan Woodward)
* LUCENE-8811: BooleanQuery#setMaxClauseCount() and #getMaxClauseCount() have
moved to IndexSearcher. The checks are now implemented using a QueryVisitor
and apply to all queries, rather than only booleans. (Atri Sharma, Adrien
Grand, Alan Woodward)
Improvements
@ -60,11 +62,6 @@ API Changes
This change is fully backwards compatible since ExecutorService directly
implements Executor. (Simon Willnauer)
* LUCENE-8811: BooleanQuery#setMaxClauseCount() and #getMaxClauseCount() have
moved to IndexSearcher. The checks are now implemented using a QueryVisitor
and apply to all queries, rather than only booleans. (Atri Sharma, Adrien
Grand, Alan Woodward)
* LUCENE-8856: Intervals queries have moved from the sandbox to the queries
module. (Alan Woodward)

View File

@ -41,6 +41,34 @@ import org.apache.lucene.search.BooleanClause.Occur;
*/
public class BooleanQuery extends Query implements Iterable<BooleanClause> {
/** Thrown when an attempt is made to add more than {@link
* #getMaxClauseCount()} clauses. This typically happens if
* a PrefixQuery, FuzzyQuery, WildcardQuery, or TermRangeQuery
* is expanded to many terms during search.
* @deprecated use {@link IndexSearcher.TooManyClauses}
*/
@Deprecated // Remove in Lucene 10
public static class TooManyClauses extends IndexSearcher.TooManyClauses { }
/** Return the maximum number of clauses permitted, 1024 by default.
* Attempts to add more than the permitted number of clauses cause {@link
* TooManyClauses} to be thrown.
* @see IndexSearcher#setMaxClauseCount(int)
* @deprecated use {@link IndexSearcher#getMaxClauseCount()}
*/
@Deprecated // Remove in Lucene 10
public static int getMaxClauseCount() { return IndexSearcher.getMaxClauseCount(); }
/**
* Set the maximum number of clauses permitted per BooleanQuery.
* Default value is 1024.
* @deprecated use {@link IndexSearcher#setMaxClauseCount(int)}
*/
@Deprecated // Remove in Lucene 10
public static void setMaxClauseCount(int maxClauseCount) {
IndexSearcher.setMaxClauseCount(maxClauseCount);
}
/** A builder for boolean queries. */
public static class Builder {