Lucene++ - a full-featured, c++ search engine
API Documentation
This class is very similar to SpanTermQuery
except that it factors in the value of the payload located at each of the positions where the Term
occurs.
More...
#include <PayloadTermQuery.h>
Public Member Functions | |
PayloadTermQuery (const TermPtr &term, const PayloadFunctionPtr &function, bool includeSpanScore=true) | |
virtual | ~PayloadTermQuery () |
virtual String | getClassName () |
boost::shared_ptr< PayloadTermQuery > | shared_from_this () |
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 LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr()) |
Returns a clone of this query. | |
virtual bool | equals (const LuceneObjectPtr &other) |
Return whether two objects are equal. | |
virtual int32_t | hashCode () |
Return hash code for this object. | |
![]() | |
SpanTermQuery (const TermPtr &term) | |
Construct a SpanTermQuery matching the named term's spans. | |
virtual | ~SpanTermQuery () |
boost::shared_ptr< SpanTermQuery > | shared_from_this () |
TermPtr | getTerm () |
Return the term whose spans are matched. | |
virtual String | getField () |
Returns the name of the field matched by this query. | |
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 String | toString (const String &field) |
Prints a query to a string, with field assumed to be the default field and omitted. | |
virtual SpansPtr | getSpans (const IndexReaderPtr &reader) |
Returns the matches for this query in an index. Used internally to search for spans. | |
![]() | |
virtual | ~SpanQuery () |
boost::shared_ptr< SpanQuery > | shared_from_this () |
![]() | |
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 | weight (const SearcherPtr &searcher) |
Constructs and initializes a Weight for a top-level query. | |
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 QueryPtr | combine (Collection< QueryPtr > queries) |
Called when re-writing queries under MultiSearcher. | |
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. | |
Static Public Member Functions | |
static String | _getClassName () |
![]() | |
static String | _getClassName () |
![]() | |
static String | _getClassName () |
![]() | |
static String | _getClassName () |
static QueryPtr | mergeBooleanQueries (Collection< BooleanQueryPtr > queries) |
Merges the clauses of a set of BooleanQuery's into a single BooleanQuery. | |
Protected Attributes | |
PayloadFunctionPtr | function |
bool | includeSpanScore |
![]() | |
TermPtr | term |
![]() | |
double | boost |
![]() | |
SynchronizePtr | objectLock |
LuceneSignalPtr | objectSignal |
Additional Inherited Members | |
![]() | |
LuceneObject () | |
This class is very similar to SpanTermQuery
except that it factors in the value of the payload located at each of the positions where the Term
occurs.
In order to take advantage of this, you must override Similarity#scorePayload(int32_t, const String&,
int32_t, int32_t, ByteArray, int32_t, int32_t)
which returns 1 by default.
Payload scores are aggregated using a pluggable PayloadFunction
.
Lucene::PayloadTermQuery::PayloadTermQuery | ( | const TermPtr & | term, |
const PayloadFunctionPtr & | function, | ||
bool | includeSpanScore = true |
||
) |
|
virtual |
|
inlinestatic |
|
virtual |
Returns a clone of this query.
Reimplemented from Lucene::SpanTermQuery.
|
virtual |
Constructs an appropriate Weight implementation for this query. Only implemented by primitive queries, which re-write to themselves.
Reimplemented from Lucene::SpanQuery.
|
virtual |
Return whether two objects are equal.
Reimplemented from Lucene::SpanTermQuery.
|
inlinevirtual |
Reimplemented from Lucene::SpanTermQuery.
|
virtual |
Return hash code for this object.
Reimplemented from Lucene::SpanTermQuery.
|
inline |
|
protected |
|
protected |