Lucene.Net  3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties
Classes | Public Member Functions | Properties | List of all members
Lucene.Net.Search.BooleanQuery Class Reference

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.
 

Detailed Description

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.

Constructor & Destructor Documentation

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

Parameters
disableCoorddisables Similarity.Coord(int,int) in scoring.

Definition at line 115 of file BooleanQuery.cs.

Member Function Documentation

virtual void Lucene.Net.Search.BooleanQuery.Add ( Query  query,
Occur  occur 
)
virtual

Adds a clause to a boolean query.

<throws> TooManyClauses if the new number of clauses exceeds the maximum clause number </throws>

See Also
MaxClauseCount

Definition at line 171 of file BooleanQuery.cs.

virtual void Lucene.Net.Search.BooleanQuery.Add ( BooleanClause  clause)
virtual

Adds a clause to a boolean query.

<throws> TooManyClauses if the new number of clauses exceeds the maximum clause number </throws>

See Also
MaxClauseCount

Definition at line 180 of file BooleanQuery.cs.

override System.Object Lucene.Net.Search.BooleanQuery.Clone ( )
virtual

Returns a clone of this query.

Reimplemented from Lucene.Net.Search.Query.

Definition at line 508 of file BooleanQuery.cs.

override Weight Lucene.Net.Search.BooleanQuery.CreateWeight ( Searcher  searcher)
virtual

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.

override void Lucene.Net.Search.BooleanQuery.ExtractTerms ( System.Collections.Generic.ISet< Term terms)
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 BooleanClause [] Lucene.Net.Search.BooleanQuery.GetClauses ( )
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.

Returns

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.

override Similarity Lucene.Net.Search.BooleanQuery.GetSimilarity ( Searcher  searcher)
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 bool Lucene.Net.Search.BooleanQuery.IsCoordDisabled ( )
virtual

Returns true iff Similarity.Coord(int,int) is disabled in scoring for this query instance.

See Also
BooleanQuery(bool)

Definition at line 125 of file BooleanQuery.cs.

override Query Lucene.Net.Search.BooleanQuery.Rewrite ( IndexReader  reader)
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.

override System.String Lucene.Net.Search.BooleanQuery.ToString ( System.String  field)
virtual

Prints a user-readable version of this query.

Implements Lucene.Net.Search.Query.

Definition at line 516 of file BooleanQuery.cs.

Property Documentation

virtual System.Collections.Generic.List<BooleanClause> Lucene.Net.Search.BooleanQuery.Clauses
get

Returns the list of clauses in this query.

Definition at line 196 of file BooleanQuery.cs.

int Lucene.Net.Search.BooleanQuery.MaxClauseCount
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.

virtual int Lucene.Net.Search.BooleanQuery.MinimumNumberShouldMatch
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.


The documentation for this class was generated from the following file: