The BooleanQuery type exposes the following members.
Constructors
Name | Description | |
---|---|---|
BooleanQuery()()()() | Constructs an empty boolean query. | |
BooleanQuery(Boolean) | Constructs an empty boolean query.
{@link Similarity#Coord(int,int)} may be disabled in scoring, as
appropriate. For example, this score factor does not make sense for most
automatically generated queries, like {@link WildcardQuery} and {@link
FuzzyQuery}.
|
Methods
Name | Description | |
---|---|---|
Add(BooleanClause) | Adds a clause to a boolean query. | |
Add(Query, BooleanClause..::..Occur) | Adds a clause to a boolean query.
| |
Clauses | Returns the list of clauses in this query. | |
Clone | (Overrides Query..::..Clone()()()().) | |
Combine | Expert: called when re-writing queries under MultiSearcher.
Create a single query suitable for use by all subsearchers (in 1-1
correspondence with queries). This is an optimization of the OR of
all queries. We handle the common optimization cases of equal
queries and overlapping clauses of boolean OR queries (as generated
by MultiTermQuery.rewrite()).
Be careful overriding this method as queries[0] determines which
method will be called and is not necessarily of the same type as
the other queries.
(Inherited from Query.) | |
CreateWeight | (Overrides Query..::..CreateWeight(Searcher).) | |
Equals | Returns true iff (Overrides Query..::..Equals(Object).)CopyC# o | |
ExtractTerms | (Overrides Query..::..ExtractTerms(Hashtable).) | |
Finalize | Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) | |
GetAllowDocsOutOfOrder | Obsolete. Whether hit docs may be collected out of docid order.
| |
GetBoost | Gets the boost for this clause. Documents matching
this clause will (in addition to the normal weightings) have their score
multiplied by (Inherited from Query.)CopyC# b | |
GetClauses | Returns the set of clauses in this query. | |
GetHashCode | Returns a hash code value for this object. (Overrides Query..::..GetHashCode()()()().) | |
GetMaxClauseCount | 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.
| |
GetMinimumNumberShouldMatch | Gets the minimum number of the optional BooleanClauses
which must be satisifed.
| |
GetSimilarity | (Overrides Query..::..GetSimilarity(Searcher).) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetUseScorer14 | Obsolete. | |
IsCoordDisabled | Returns true iff {@link Similarity#Coord(int,int)} is disabled in
scoring for this query instance.
| |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Rewrite | (Overrides Query..::..Rewrite(IndexReader).) | |
SetAllowDocsOutOfOrder | Obsolete. 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, docid N might be scored for a
single segment before docid N-1. Across multiple segments, docs may be
scored out of order regardless of this setting - it only applies to scoring
a single segment.
Being static, this setting is system wide.
| |
SetBoost | Sets the boost for this query clause to (Inherited from Query.)CopyC# b CopyC# b | |
SetMaxClauseCount | Set the maximum number of clauses permitted per BooleanQuery.
Default value is 1024.
| |
SetMinimumNumberShouldMatch | 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.
| |
SetUseScorer14 | Obsolete. | |
ToString()()()() | Prints a query to a string. (Inherited from Query.) | |
ToString(String) | Prints a user-readable version of this query. (Overrides Query..::..ToString(String).) | |
Weight | Expert: Constructs and initializes a Weight for a top-level query. (Inherited from Query.) |
Fields
Name | Description | |
---|---|---|
minNrShouldMatch |