|
| TermRangeQuery (const String &fieldName, StringValue lowerTerm, StringValue upperTerm, bool includeLower, bool includeUpper, CollatorPtr collator=CollatorPtr()) |
| Constructs a query selecting all terms greater/equal than lowerTerm but less/equal than upperTerm.
|
|
virtual | ~TermRangeQuery () |
|
virtual String | getClassName () |
|
boost::shared_ptr< TermRangeQuery > | shared_from_this () |
|
String | getField () |
| Returns the field name for this query.
|
|
String | getLowerTerm () |
| Returns the lower value of this range query.
|
|
String | getUpperTerm () |
| Returns the upper value of this range query.
|
|
bool | includesLower () |
| Returns true if the lower endpoint is inclusive.
|
|
bool | includesUpper () |
| Returns true if the upper endpoint is inclusive.
|
|
CollatorPtr | getCollator () |
| Returns the collator used to determine range inclusion, if any.
|
|
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr()) |
| Returns a clone of this query.
|
|
virtual String | toString (const String &field) |
| Prints a query to a string, with field assumed to be the default field and omitted.
|
|
virtual int32_t | hashCode () |
| Return hash code for this object.
|
|
virtual bool | equals (const LuceneObjectPtr &other) |
| Return whether two objects are equal.
|
|
| MultiTermQuery () |
|
virtual | ~MultiTermQuery () |
|
boost::shared_ptr< MultiTermQuery > | shared_from_this () |
|
int32_t | getTotalNumberOfTerms () |
| 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.
|
|
void | clearTotalNumberOfTerms () |
| Resets the counting of unique terms. Do this before executing the query/filter.
|
|
virtual QueryPtr | rewrite (const IndexReaderPtr &reader) |
| Called to re-write queries into primitive queries. For example, a PrefixQuery will be rewritten into a BooleanQuery that consists of TermQuerys.
|
|
virtual RewriteMethodPtr | getRewriteMethod () |
|
virtual void | setRewriteMethod (const RewriteMethodPtr &method) |
| 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 RewriteMethod .
|
|
| Query () |
|
virtual | ~Query () |
|
boost::shared_ptr< Query > | shared_from_this () |
|
virtual void | setBoost (double b) |
| 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.
|
|
virtual double | getBoost () |
| Gets the boost for this clause. Documents matching this clause will (in addition to the normal weightings) have their score multiplied by b. The boost is 1.0 by default.
|
|
virtual String | toString () |
| Prints a query to a string.
|
|
virtual WeightPtr | createWeight (const SearcherPtr &searcher) |
| Constructs an appropriate Weight implementation for this query. Only implemented by primitive queries, which re-write to themselves.
|
|
virtual WeightPtr | weight (const SearcherPtr &searcher) |
| Constructs and initializes a Weight for a top-level query.
|
|
virtual QueryPtr | combine (Collection< QueryPtr > queries) |
| Called when re-writing queries under MultiSearcher.
|
|
virtual void | extractTerms (SetTerm terms) |
| Adds all terms occurring in this query to the terms set. Only works if this query is in its rewritten form.
|
|
virtual SimilarityPtr | getSimilarity (const SearcherPtr &searcher) |
| 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.
|
|
String | boostString () |
| Return given boost value as a string.
|
|
virtual | ~LuceneObject () |
|
virtual void | initialize () |
| Called directly after instantiation to create objects that depend on this object being fully constructed.
|
|
virtual int32_t | compareTo (const LuceneObjectPtr &other) |
| Compare two objects.
|
|
virtual | ~LuceneSync () |
|
virtual SynchronizePtr | getSync () |
| Return this object synchronize lock.
|
|
virtual LuceneSignalPtr | getSignal () |
| Return this object signal.
|
|
virtual void | lock (int32_t timeout=0) |
| Lock this object using an optional timeout.
|
|
virtual void | unlock () |
| Unlock this object.
|
|
virtual bool | holdsLock () |
| Returns true if this object is currently locked by current thread.
|
|
virtual void | wait (int32_t timeout=0) |
| Wait for signal using an optional timeout.
|
|
virtual void | notifyAll () |
| Notify all threads waiting for signal.
|
|
A Query that matches documents within an range of terms.
This query matches the documents looking for terms that fall into the supplied range according to String#compare(String)
, unless a Collator is provided. It is not intended for numerical ranges; use NumericRangeQuery
instead.
This query uses the MultiTermQuery#CONSTANT_SCORE_AUTO_REWRITE_DEFAULT
rewrite method.
Lucene::TermRangeQuery::TermRangeQuery |
( |
const String & |
fieldName, |
|
|
StringValue |
lowerTerm, |
|
|
StringValue |
upperTerm, |
|
|
bool |
includeLower, |
|
|
bool |
includeUpper, |
|
|
CollatorPtr |
collator = CollatorPtr() |
|
) |
| |
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.
- Parameters
-
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. |
virtual String Lucene::TermRangeQuery::toString |
( |
const String & |
field | ) |
|
|
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 (eg. span queries) don't have a representation that can be parsed by QueryParser.
Reimplemented from Lucene::Query.