The BooleanQuery type exposes the following members.

Constructors

  NameDescription
Public methodBooleanQuery()()()()
Constructs an empty boolean query.
Public methodBooleanQuery(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

  NameDescription
Public methodAdd(BooleanClause)
Adds a clause to a boolean query.
Public methodAdd(Query, BooleanClause..::..Occur)
Adds a clause to a boolean query.
Public methodClauses
Returns the list of clauses in this query.
Public methodClone (Overrides Query..::..Clone()()()().)
Public methodCombine
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.)
Public methodCreateWeight (Overrides Query..::..CreateWeight(Searcher).)
Public methodEquals
Returns true iff
CopyC#
o
is equal to this.
(Overrides Query..::..Equals(Object).)
Public methodExtractTerms (Overrides Query..::..ExtractTerms(Hashtable).)
Protected methodFinalize
Allows an Object to attempt to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection.
(Inherited from Object.)
Public methodStatic memberGetAllowDocsOutOfOrder Obsolete.
Whether hit docs may be collected out of docid order.
Public methodGetBoost
Gets the boost for this clause. Documents matching this clause will (in addition to the normal weightings) have their score multiplied by
CopyC#
b
. The boost is 1.0 by default.
(Inherited from Query.)
Public methodGetClauses
Returns the set of clauses in this query.
Public methodGetHashCode
Returns a hash code value for this object.
(Overrides Query..::..GetHashCode()()()().)
Public methodStatic memberGetMaxClauseCount
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.
Public methodGetMinimumNumberShouldMatch
Gets the minimum number of the optional BooleanClauses which must be satisifed.
Public methodGetSimilarity (Overrides Query..::..GetSimilarity(Searcher).)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodStatic memberGetUseScorer14 Obsolete.
Public methodIsCoordDisabled
Returns true iff {@link Similarity#Coord(int,int)} is disabled in scoring for this query instance.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRewrite (Overrides Query..::..Rewrite(IndexReader).)
Public methodStatic memberSetAllowDocsOutOfOrder 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.

Public methodSetBoost
Sets the boost for this query clause to
CopyC#
b
. Documents matching this clause will (in addition to the normal weightings) have their score multiplied by
CopyC#
b
.
(Inherited from Query.)
Public methodStatic memberSetMaxClauseCount
Set the maximum number of clauses permitted per BooleanQuery. Default value is 1024.
Public methodSetMinimumNumberShouldMatch
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.

Public methodStatic memberSetUseScorer14 Obsolete.
Public methodToString()()()()
Prints a query to a string.
(Inherited from Query.)
Public methodToString(String)
Prints a user-readable version of this query.
(Overrides Query..::..ToString(String).)
Public methodWeight
Expert: Constructs and initializes a Weight for a top-level query.
(Inherited from Query.)

Fields

  NameDescription
Protected fieldminNrShouldMatch

See Also