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
Public Member Functions | Static Public Member Functions | Properties | List of all members
Lucene.Net.Search.Query Class Referenceabstract

The abstract base class for queries. Instantiable subclasses are:

A parser for queries is contained in:

More...

Inherits ICloneable.

Inherited by Lucene.Net.Search.BooleanQuery, Lucene.Net.Search.BoostingQuery, Lucene.Net.Search.ConstantScoreQuery, Lucene.Net.Search.DisjunctionMaxQuery, Lucene.Net.Search.FilteredQuery, Lucene.Net.Search.Function.CustomScoreQuery, Lucene.Net.Search.Function.ValueSourceQuery, Lucene.Net.Search.FuzzyLikeThisQuery, Lucene.Net.Search.MatchAllDocsQuery, Lucene.Net.Search.MultiPhraseQuery, Lucene.Net.Search.MultiTermQuery, Lucene.Net.Search.PhraseQuery, Lucene.Net.Search.Similar.MoreLikeThisQuery, Lucene.Net.Search.Spans.SpanQuery, Lucene.Net.Search.TermQuery, and Lucene.Net.Spatial.Util.FunctionQuery.

Public Member Functions

abstract System.String ToString (System.String field)
 Prints a query to a string, with field assumed to be the default field and omitted. The representation used is one that is supposed to be readable by QueryParser. However, there are the following limitations:

  • If the query was created by the parser, the printed representation may not be exactly what was parsed. For example, characters that need to be escaped will be represented without the required backslash.
  • Some of the more complicated queries (e.g. span queries) don't have a representation that can be parsed by QueryParser.

 
override System.String ToString ()
 Prints a query to a string.
 
virtual Weight CreateWeight (Searcher searcher)
 Expert: Constructs an appropriate Weight implementation for this query.
 
virtual Weight Weight (Searcher searcher)
 Expert: Constructs and initializes a Weight for a top-level query.
 
virtual 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.
 
virtual Query Combine (Query[] queries)
 Expert: called when re-writing queries under MultiSearcher.
 
virtual 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.
 
virtual 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 System.Object Clone ()
 Returns a clone of this query.
 
override int GetHashCode ()
 
override bool Equals (System.Object obj)
 

Static Public Member Functions

static Query MergeBooleanQueries (params BooleanQuery[] queries)
 Expert: merges the clauses of a set of BooleanQuery's into a single BooleanQuery.
 

Properties

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.
 

Detailed Description

The abstract base class for queries.

Instantiable subclasses are:

A parser for queries is contained in:

Definition at line 47 of file Query.cs.

Member Function Documentation

virtual System.Object Lucene.Net.Search.Query.Clone ( )
virtual
virtual Query Lucene.Net.Search.Query.Combine ( Query[]  queries)
virtual

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.

Definition at line 128 of file Query.cs.

virtual Weight Lucene.Net.Search.Query.CreateWeight ( Searcher  searcher)
virtual
override bool Lucene.Net.Search.Query.Equals ( System.Object  obj)

Definition at line 243 of file Query.cs.

virtual void Lucene.Net.Search.Query.ExtractTerms ( System.Collections.Generic.ISet< Term terms)
virtual
override int Lucene.Net.Search.Query.GetHashCode ( )

Definition at line 235 of file Query.cs.

virtual Similarity Lucene.Net.Search.Query.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 in Lucene.Net.Search.BooleanQuery, and Lucene.Net.Search.Spans.FieldMaskingSpanQuery.

Definition at line 217 of file Query.cs.

static Query Lucene.Net.Search.Query.MergeBooleanQueries ( params BooleanQuery[]  queries)
static

Expert: merges the clauses of a set of BooleanQuery's into a single BooleanQuery.

A utility for use by Combine(Query[]) implementations.

Definition at line 191 of file Query.cs.

virtual Query Lucene.Net.Search.Query.Rewrite ( IndexReader  reader)
virtual
abstract System.String Lucene.Net.Search.Query.ToString ( System.String  field)
pure virtual

Prints a query to a string, with field assumed to be the default field and omitted. The representation used is one that is supposed to be readable by QueryParser. However, there are the following limitations:

  • If the query was created by the parser, the printed representation may not be exactly what was parsed. For example, characters that need to be escaped will be represented without the required backslash.
  • Some of the more complicated queries (e.g. span queries) don't have a representation that can be parsed by QueryParser.

Implemented in Lucene.Net.Search.BooleanQuery, Lucene.Net.Search.MultiPhraseQuery, Lucene.Net.Search.PhraseQuery, Lucene.Net.Search.DisjunctionMaxQuery, Lucene.Net.Search.FilteredQuery, Lucene.Net.Search.Spans.SpanOrQuery, Lucene.Net.Search.NumericRangeQuery< T >, Lucene.Net.Search.TermQuery, Lucene.Net.Search.Function.ValueSourceQuery, Lucene.Net.Search.FuzzyQuery, Lucene.Net.Search.Spans.SpanNotQuery, Lucene.Net.Search.MatchAllDocsQuery, Lucene.Net.Search.TermRangeQuery, Lucene.Net.Search.Spans.SpanFirstQuery, Lucene.Net.Search.Function.CustomScoreQuery, Lucene.Net.Search.Spans.FieldMaskingSpanQuery, Lucene.Net.Search.Spans.SpanNearQuery, Lucene.Net.Search.WildcardQuery, Lucene.Net.Search.PrefixQuery, and Lucene.Net.Search.Spans.SpanTermQuery.

override System.String Lucene.Net.Search.Query.ToString ( )

Prints a query to a string.

Definition at line 78 of file Query.cs.

virtual Weight Lucene.Net.Search.Query.Weight ( Searcher  searcher)
virtual

Expert: Constructs and initializes a Weight for a top-level query.

Definition at line 94 of file Query.cs.

Property Documentation

virtual float Lucene.Net.Search.Query.Boost
getset

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.

Definition at line 56 of file Query.cs.


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