setAllowDocsOutOfOrder(boolean allow) Expert: Indicates whether hit docs may be collected out of docid
order.
Background: although the contract of the Scorer class requires that
documents be iterated in order of doc id, this was not true in early
versions of Lucene.
public static void
setMaxClauseCount(int maxClauseCount) Set the maximum number of clauses permitted per BooleanQuery.
Default value is 1024.
TermQuery clauses are generated from for example prefix queries and
fuzzy queries.
public void
setMinimumNumberShouldMatch(int min) Specifies a minimum number of the optional BooleanClauses
which must be satisfied.
By default no optional clauses are necessary for a match
(unless there are no required clauses).
Constructs an empty boolean query.
Similarity.coord(intint) may be disabled in scoring, as
appropriate. For example, this score factor does not make sense for most
automatically generated queries, like
WildcardQuery and
FuzzyQuery .
Parameters: disableCoord - disables Similarity.coord(intint) in scoring.
Adds a clause to a boolean query.
throws: TooManyClauses - if the new number of clauses exceeds the maximum clause number See Also:BooleanQuery.getMaxClauseCount()
Adds a clause to a boolean query.
throws: TooManyClauses - if the new number of clauses exceeds the maximum clause number See Also:BooleanQuery.getMaxClauseCount()
Return the maximum number of clauses permitted, 1024 by default.
Attempts to add more than the permitted number of clauses cause
TooManyClauses to be thrown.
See Also:BooleanQuery.setMaxClauseCount(int)
public static void setAllowDocsOutOfOrder(boolean allow)(Code)
Expert: Indicates whether hit docs may be collected out of docid
order.
Background: although the contract of the Scorer class requires that
documents be iterated in order of doc id, this was not true in early
versions of Lucene. Many pieces of functionality in the current
Lucene code base have undefined behavior if this contract is not
upheld, but in some specific simple cases may be faster. (For
example: disjunction queries with less than 32 prohibited clauses;
This setting has no effect for other queries.)
Specifics: By setting this option to true, calls to
HitCollector.collect(intfloat) might be
invoked first for docid N and only later for docid N-1.
Being static, this setting is system wide.
setMaxClauseCount
public static void setMaxClauseCount(int maxClauseCount)(Code)
Set the maximum number of clauses permitted per BooleanQuery.
Default value is 1024.
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.
When this parameter becomes a bottleneck for a Query one can use a
Filter. For example instead of a
RangeQuery one can use a
RangeFilter .
Normally the buffers are allocated by the JVM. When using for example
org.apache.lucene.store.MMapDirectory the buffering is left to
the operating system.
setMinimumNumberShouldMatch
public void setMinimumNumberShouldMatch(int min)(Code)
Specifies a minimum number of the optional BooleanClauses
which must be satisfied.
By default no optional clauses are necessary for a match
(unless there are no required clauses). If this method is used,
then the specified number of clauses is required.
Use of this method is totally independent of specifying that
any specific clauses are required (or prohibited). This number will
only be compared against the number of matching optional clauses.
EXPERT NOTE: Using this method may force collecting docs in order,
regardless of whether setAllowDocsOutOfOrder(true) has been called.