Lucene.Net
3.0.3
Lucene.Net is a .NET port of the Java Lucene Indexing Library
|
A Query that matches documents within an exclusive range of terms. More...
Inherits Lucene.Net.Search.MultiTermQuery.
Public Member Functions | |
TermRangeQuery (System.String field, System.String lowerTerm, System.String upperTerm, bool includeLower, bool includeUpper) | |
Constructs a query selecting all terms greater/equal than lowerTerm but less/equal than upperTerm . | |
TermRangeQuery (System.String field, System.String lowerTerm, System.String upperTerm, bool includeLower, bool includeUpper, System.Globalization.CompareInfo collator) | |
Constructs a query selecting all terms greater/equal than lowerTerm but less/equal than upperTerm . If an endpoint is null, it is said to be "open". Either or both endpoints may be open. Open endpoints may not be exclusive (you can't select all but the first or last term without explicitly specifying the term to exclude.) If collator is not null, it will be used to decide whether index terms are within the given range, rather than using the Unicode code point order in which index terms are stored. WARNING: Using this constructor and supplying a non-null value in the collator parameter will cause every single index Term in the Field referenced by lowerTerm and/or upperTerm to be examined. Depending on the number of index Terms in this Field, the operation could be very slow. | |
override System.String | ToString (System.String field) |
Prints a user-readable version of this query. | |
override int | GetHashCode () |
override bool | Equals (System.Object obj) |
Public Member Functions inherited from Lucene.Net.Search.MultiTermQuery | |
virtual void | ClearTotalNumberOfTerms () |
Expert: Resets the counting of unique terms. Do this before executing the query/filter. | |
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 int | GetHashCode () |
override bool | Equals (System.Object obj) |
Public Member Functions inherited from Lucene.Net.Search.Query | |
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 | 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) |
Properties | |
virtual string | Field [get] |
Returns the field name for this query | |
virtual string | LowerTerm [get] |
Returns the lower value of this range query | |
virtual string | UpperTerm [get] |
Returns the upper value of this range query | |
virtual bool | IncludesLower [get] |
Returns true if the lower endpoint is inclusive | |
virtual bool | IncludesUpper [get] |
Returns true if the upper endpoint is inclusive | |
virtual CompareInfo | Collator [get] |
Returns the collator used to determine range inclusion, if any. | |
Properties inherited from Lucene.Net.Search.MultiTermQuery | |
virtual int | TotalNumberOfTerms [get] |
Expert: Return the number of unique terms visited during execution of the query. If there are many of them, you may consider using another query type or optimize your total term count in index. This method is not thread safe, be sure to only call it when no query is running! If you re-use the same query instance for another search, be sure to first reset the term counter with ClearTotalNumberOfTerms. On optimized indexes / no MultiReaders, you get the correct number of unique terms for the whole index. Use this number to compare different queries. For non-optimized indexes this number can also be achived in non-constant-score mode. In constant-score mode you get the total number of terms seeked for all segments / sub-readers. | |
virtual RewriteMethod | RewriteMethod [get, set] |
Sets the rewrite method to be used when executing the query. You can use one of the four core methods, or implement your own subclass of Search.RewriteMethod. | |
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. | |
Static Public Attributes inherited from Lucene.Net.Search.MultiTermQuery | |
static readonly RewriteMethod | CONSTANT_SCORE_FILTER_REWRITE = new ConstantScoreFilterRewrite() |
A rewrite method that first creates a private Filter, by visiting each term in sequence and marking all docs for that term. Matching documents are assigned a constant score equal to the query's boost. | |
static readonly RewriteMethod | SCORING_BOOLEAN_QUERY_REWRITE = new ScoringBooleanQueryRewrite() |
A rewrite method that first translates each term into Occur.SHOULD clause in a BooleanQuery, and keeps the scores as computed by the query. Note that typically such scores are meaningless to the user, and require non-trivial CPU to compute, so it's almost always better to use CONSTANT_SCORE_AUTO_REWRITE_DEFAULT instead. | |
static readonly RewriteMethod | CONSTANT_SCORE_BOOLEAN_QUERY_REWRITE = new ConstantScoreBooleanQueryRewrite() |
Like SCORING_BOOLEAN_QUERY_REWRITE except scores are not computed. Instead, each matching document receives a constant score equal to the query's boost. | |
static readonly RewriteMethod | CONSTANT_SCORE_AUTO_REWRITE_DEFAULT |
Read-only default instance of ConstantScoreAutoRewrite , with ConstantScoreAutoRewrite.TermCountCutoff set to ConstantScoreAutoRewrite.DEFAULT_TERM_COUNT_CUTOFF | |
Protected Member Functions inherited from Lucene.Net.Search.MultiTermQuery | |
MultiTermQuery () | |
Constructs a query matching terms that cannot be represented with a single Term. | |
A Query that matches documents within an exclusive range of terms.
This query matches the documents looking for terms that fall into the supplied range according to String.CompareTo(String). It is not intended for numerical ranges, use NumericRangeQuery{T} instead.
This query uses the MultiTermQuery.CONSTANT_SCORE_AUTO_REWRITE_DEFAULT
rewrite method.
<since> 2.9 </since>
Definition at line 40 of file TermRangeQuery.cs.
Lucene.Net.Search.TermRangeQuery.TermRangeQuery | ( | System.String | field, |
System.String | lowerTerm, | ||
System.String | upperTerm, | ||
bool | includeLower, | ||
bool | includeUpper | ||
) |
Constructs a query selecting all terms greater/equal than lowerTerm
but less/equal than upperTerm
.
If an endpoint is null, it is said to be "open". Either or both endpoints may be open. Open endpoints may not be exclusive (you can't select all but the first or last term without explicitly specifying the term to exclude.)
field | The field that holds both lower and upper terms. |
lowerTerm | The term text at the lower end of the range |
upperTerm | The term text at the upper end of the range |
includeLower | If true, the lowerTerm is included in the range. |
includeUpper | If true, the upperTerm is included in the range. |
Definition at line 72 of file TermRangeQuery.cs.
Lucene.Net.Search.TermRangeQuery.TermRangeQuery | ( | System.String | field, |
System.String | lowerTerm, | ||
System.String | upperTerm, | ||
bool | includeLower, | ||
bool | includeUpper, | ||
System.Globalization.CompareInfo | collator | ||
) |
Constructs a query selecting all terms greater/equal than lowerTerm
but less/equal than upperTerm
. If an endpoint is null, it is said to be "open". Either or both endpoints may be open. Open endpoints may not be exclusive (you can't select all but the first or last term without explicitly specifying the term to exclude.) If collator
is not null, it will be used to decide whether index terms are within the given range, rather than using the Unicode code point order in which index terms are stored. WARNING: Using this constructor and supplying a non-null value in the collator
parameter will cause every single index Term in the Field referenced by lowerTerm and/or upperTerm to be examined. Depending on the number of index Terms in this Field, the operation could be very slow.
field | |
lowerTerm | The Term text at the lower end of the range |
upperTerm | The Term text at the upper end of the range |
includeLower | If true, the lowerTerm is included in the range. |
includeUpper | If true, the upperTerm is included in the range. |
collator | The collator to use to collate index Terms, to determine their membership in the range bounded by lowerTerm and upperTerm . |
Definition at line 110 of file TermRangeQuery.cs.
override bool Lucene.Net.Search.TermRangeQuery.Equals | ( | System.Object | obj | ) |
Definition at line 194 of file TermRangeQuery.cs.
override int Lucene.Net.Search.TermRangeQuery.GetHashCode | ( | ) |
Definition at line 180 of file TermRangeQuery.cs.
|
virtual |
Prints a user-readable version of this query.
Implements Lucene.Net.Search.Query.
Definition at line 162 of file TermRangeQuery.cs.
|
get |
Returns the collator used to determine range inclusion, if any.
Definition at line 152 of file TermRangeQuery.cs.
|
get |
Returns the field name for this query
Definition at line 122 of file TermRangeQuery.cs.
|
get |
Returns true
if the lower endpoint is inclusive
Definition at line 140 of file TermRangeQuery.cs.
|
get |
Returns true
if the upper endpoint is inclusive
Definition at line 146 of file TermRangeQuery.cs.
|
get |
Returns the lower value of this range query
Definition at line 128 of file TermRangeQuery.cs.
|
get |
Returns the upper value of this range query
Definition at line 134 of file TermRangeQuery.cs.