maxClauseCount: deprecate public field, no more setting via system property

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@219250 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Daniel Naber 2005-07-15 21:03:33 +00:00
parent 71067fa4ff
commit d6ee6c0845
2 changed files with 25 additions and 23 deletions

View File

@ -45,11 +45,14 @@ Changes in runtime behavior
7. Several default values cannot be set via system properties anymore, as
this has been considered inappropriate for a library like Lucene. For
most properties there are set/get methods available in IndexWriter which
you should use instead.
This affects the following properties: org.apache.lucene.writeLockTimeout,
org.apache.lucene.commitLockTimeout, org.apache.lucene.minMergeDocs,
org.apache.lucene.maxMergeDocs, org.apache.lucene.maxFieldLength,
org.apache.lucene.termIndexInterval, org.apache.lucene.mergeFactor
you should use instead. This affects the following properties:
See IndexWriter for getter/setter methods:
org.apache.lucene.writeLockTimeout, org.apache.lucene.commitLockTimeout,
org.apache.lucene.minMergeDocs, org.apache.lucene.maxMergeDocs,
org.apache.lucene.maxFieldLength, org.apache.lucene.termIndexInterval,
org.apache.lucene.mergeFactor,
See BooleanQuery for getter/setter methods:
org.apache.lucene.maxClauseCount
(Daniel Naber)
New features

View File

@ -29,23 +29,10 @@ import org.apache.lucene.index.IndexReader;
*/
public class BooleanQuery extends Query {
/** The maximum number of clauses permitted. Default value is 1024.
* Use the <code>org.apache.lucene.maxClauseCount</code> system property
* to override.
* <p>TermQuery clauses are generated from for example prefix queries and
* fuzzy queries. Each TermQuery needs some buffer space during search,
* so this parameter indirectly controls the maximum buffer requirements for
* query search.
* <p>When this parameter becomes a bottleneck for a Query one can use a
* Filter. For example instead of a {@link RangeQuery} one can use a
* {@link RangeFilter}.
* <p>Normally the buffers are allocated by the JVM. When using for example
* {@link org.apache.lucene.store.MMapDirectory} the buffering is left to
* the operating system.
/**
* @deprecated use {@link #setMaxClauseCount(int)} instead
*/
public static int maxClauseCount =
Integer.parseInt(System.getProperty("org.apache.lucene.maxClauseCount",
"1024"));
public static int maxClauseCount = 1024;
/** Thrown when an attempt is made to add more than {@link
* #getMaxClauseCount()} clauses. This typically happens if
@ -57,11 +44,23 @@ public class BooleanQuery extends Query {
/** 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 #maxClauseCount
* @see #setMaxClauseCount(int)
*/
public static int getMaxClauseCount() { return maxClauseCount; }
/** Set the maximum number of clauses permitted. */
/** Set the maximum number of clauses permitted per BooleanQuery.
* Default value is 1024.
* <p>TermQuery clauses are generated from for example prefix queries and
* fuzzy queries. Each TermQuery needs some buffer space during search,
* so this parameter indirectly controls the maximum buffer requirements for
* query search.
* <p>When this parameter becomes a bottleneck for a Query one can use a
* Filter. For example instead of a {@link RangeQuery} one can use a
* {@link RangeFilter}.
* <p>Normally the buffers are allocated by the JVM. When using for example
* {@link org.apache.lucene.store.MMapDirectory} the buffering is left to
* the operating system.
*/
public static void setMaxClauseCount(int maxClauseCount) {
BooleanQuery.maxClauseCount = maxClauseCount;
}