Lucene.Net
3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
|
A Query that matches documents matching boolean combinations of other queries, e.g. TermQuerys, PhraseQuerys or other BooleanQuerys. More...
Inherits Lucene.Net.Search.Query, IEnumerable< BooleanClause >, and ICloneable.
Inherited by Lucene.Net.Search.BoostingQuery.AnonymousBooleanQuery.
Classes | |
class | BooleanWeight |
Expert: the Weight for BooleanQuery, used to normalize, score and explain these queries. | |
class | TooManyClauses |
Thrown when an attempt is made to add more than MaxClauseCount clauses. This typically happens if a PrefixQuery, FuzzyQuery, WildcardQuery, or TermRangeQuery is expanded to many terms during search. More... | |
Public Member Functions | |
BooleanQuery () | |
Constructs an empty boolean query. | |
BooleanQuery (bool disableCoord) | |
Constructs an empty boolean query. | |
virtual bool | IsCoordDisabled () |
Returns true iff Similarity.Coord(int,int) is disabled in scoring for this query instance. | |
override Similarity | GetSimilarity (Searcher searcher) |
Expert: Returns the Similarity implementation to be used for this query. Subclasses may override this method to specify their own Similarity implementation, perhaps one that delegates through that of the Searcher. By default the Searcher's Similarity implementation is returned. | |
virtual void | Add (Query query, Occur occur) |
Adds a clause to a boolean query. | |
virtual void | Add (BooleanClause clause) |
Adds a clause to a boolean query. | |
virtual BooleanClause[] | GetClauses () |
Returns the set of clauses in this query. | |
System.Collections.Generic.IEnumerator < BooleanClause > | GetEnumerator () |
Returns an iterator on the clauses in this query. | |
override Weight | CreateWeight (Searcher searcher) |
Expert: Constructs an appropriate Weight implementation for this query. | |
override Query | Rewrite (IndexReader reader) |
Expert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys. | |
override void | ExtractTerms (System.Collections.Generic.ISet< Term > terms) |
Expert: adds all terms occuring in this query to the terms set. Only works if this query is in its rewritten form. | |
override System.Object | Clone () |
Returns a clone of this query. | |
override System.String | ToString (System.String field) |
Prints a user-readable version of this query. | |
override bool | Equals (System.Object o) |
Returns true iff o is equal to this. | |
override int | GetHashCode () |
Returns a hash code value for this object. | |
Public Member Functions inherited from Lucene.Net.Search.Query | |
override System.String | ToString () |
Prints a query to a string. | |
virtual Weight | Weight (Searcher searcher) |
Expert: Constructs and initializes a Weight for a top-level query. | |
virtual Query | Combine (Query[] queries) |
Expert: called when re-writing queries under MultiSearcher. | |
override int | GetHashCode () |
override bool | Equals (System.Object obj) |
Properties | |
static int | MaxClauseCount [get, set] |
Gets or sets the maximum number of clauses permitted, 1024 by default. Attempts to add more than the permitted number of clauses cause TooManyClauses to be thrown. | |
virtual int | MinimumNumberShouldMatch [get, set] |
Specifies a minimum number of the optional BooleanClauses which must be satisfied. | |
virtual System.Collections.Generic.List < BooleanClause > | Clauses [get] |
Returns the list of clauses in this query. | |
Properties inherited from Lucene.Net.Search.Query | |
virtual float | Boost [get, set] |
Gets or sets the boost for this query clause to b . Documents matching this clause will (in addition to the normal weightings) have their score multiplied by b . The boost is 1.0 by default. | |
Additional Inherited Members | |
Static Public Member Functions inherited from Lucene.Net.Search.Query | |
static Query | MergeBooleanQueries (params BooleanQuery[] queries) |
Expert: merges the clauses of a set of BooleanQuery's into a single BooleanQuery. | |
A Query that matches documents matching boolean combinations of other queries, e.g. TermQuerys, PhraseQuerys or other BooleanQuerys.
Definition at line 34 of file BooleanQuery.cs.
Lucene.Net.Search.BooleanQuery.BooleanQuery | ( | ) |
Constructs an empty boolean query.
Definition at line 101 of file BooleanQuery.cs.
Lucene.Net.Search.BooleanQuery.BooleanQuery | ( | bool | disableCoord | ) |
Constructs an empty boolean query.
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 WildcardQuery and FuzzyQuery
disableCoord | disables Similarity.Coord(int,int) in scoring. |
Definition at line 115 of file BooleanQuery.cs.
Adds a clause to a boolean query.
<throws> TooManyClauses if the new number of clauses exceeds the maximum clause number </throws>
Definition at line 171 of file BooleanQuery.cs.
|
virtual |
Adds a clause to a boolean query.
<throws> TooManyClauses if the new number of clauses exceeds the maximum clause number </throws>
Definition at line 180 of file BooleanQuery.cs.
|
virtual |
Returns a clone of this query.
Reimplemented from Lucene.Net.Search.Query.
Definition at line 508 of file BooleanQuery.cs.
Expert: Constructs an appropriate Weight implementation for this query.
Only implemented by primitive queries, which re-write to themselves.
Reimplemented from Lucene.Net.Search.Query.
Definition at line 448 of file BooleanQuery.cs.
override bool Lucene.Net.Search.BooleanQuery.Equals | ( | System.Object | o | ) |
Returns true iff o
is equal to this.
Definition at line 577 of file BooleanQuery.cs.
|
virtual |
Expert: adds all terms occuring in this query to the terms set. Only works if this query is in its rewritten form.
<throws> UnsupportedOperationException if this query is not yet rewritten </throws>
Reimplemented from Lucene.Net.Search.Query.
Definition at line 500 of file BooleanQuery.cs.
|
virtual |
Returns the set of clauses in this query.
Definition at line 189 of file BooleanQuery.cs.
System.Collections.Generic.IEnumerator<BooleanClause> Lucene.Net.Search.BooleanQuery.GetEnumerator | ( | ) |
Returns an iterator on the clauses in this query.
Definition at line 204 of file BooleanQuery.cs.
override int Lucene.Net.Search.BooleanQuery.GetHashCode | ( | ) |
Returns a hash code value for this object.
Definition at line 589 of file BooleanQuery.cs.
|
virtual |
Expert: Returns the Similarity implementation to be used for this query. Subclasses may override this method to specify their own Similarity implementation, perhaps one that delegates through that of the Searcher. By default the Searcher's Similarity implementation is returned.
Reimplemented from Lucene.Net.Search.Query.
Definition at line 132 of file BooleanQuery.cs.
|
virtual |
Returns true iff Similarity.Coord(int,int) is disabled in scoring for this query instance.
Definition at line 125 of file BooleanQuery.cs.
|
virtual |
Expert: called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.
Reimplemented from Lucene.Net.Search.Query.
Definition at line 453 of file BooleanQuery.cs.
|
virtual |
Prints a user-readable version of this query.
Implements Lucene.Net.Search.Query.
Definition at line 516 of file BooleanQuery.cs.
|
get |
Returns the list of clauses in this query.
Definition at line 196 of file BooleanQuery.cs.
|
staticgetset |
Gets or sets the maximum number of clauses permitted, 1024 by default. Attempts to add more than the permitted number of clauses cause TooManyClauses to be thrown.
Definition at line 87 of file BooleanQuery.cs.
|
getset |
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.
Definition at line 160 of file BooleanQuery.cs.