Lucene++ - a full-featured, c++ search engine
API Documentation
The positionIncrement determines the position of this token relative to the previous Token in a TokenStream, used in phrase searching. More...
#include <PositionIncrementAttribute.h>
Public Member Functions | |
PositionIncrementAttribute () | |
virtual | ~PositionIncrementAttribute () |
virtual String | getClassName () |
boost::shared_ptr< PositionIncrementAttribute > | shared_from_this () |
virtual String | toString () |
Returns a string representation of the object. | |
virtual void | setPositionIncrement (int32_t positionIncrement) |
Set the position increment. The default value is one. | |
virtual int32_t | getPositionIncrement () |
Returns the position increment of this Token. | |
virtual void | clear () |
Clears the values in this Attribute and resets it to its default value. If this implementation implements more than one Attribute interface it clears all. | |
virtual bool | equals (const LuceneObjectPtr &other) |
All values used for computation of hashCode() should be checked here for equality. | |
virtual int32_t | hashCode () |
Subclasses must implement this method and should compute a hashCode similar to this: | |
virtual void | copyTo (const AttributePtr &target) |
Copies the values from this Attribute into the passed-in target attribute. The target implementation must support all the Attributes this implementation supports. | |
virtual LuceneObjectPtr | clone (const LuceneObjectPtr &other=LuceneObjectPtr()) |
Shallow clone. Subclasses must override this if they need to clone any members deeply. | |
![]() | |
virtual | ~Attribute () |
boost::shared_ptr< Attribute > | shared_from_this () |
![]() | |
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 () |
Protected Attributes | |
int32_t | positionIncrement |
![]() | |
SynchronizePtr | objectLock |
LuceneSignalPtr | objectSignal |
Additional Inherited Members | |
![]() | |
LuceneObject () | |
The positionIncrement determines the position of this token relative to the previous Token in a TokenStream, used in phrase searching.
The default value is one.
Some common uses for this are:
Set it to zero to put multiple terms in the same position. This is useful if, eg., a word has multiple stems. Searches for phrases including either stem will match. In this case, all but the first stem's increment should be set to zero: the increment of the first instance should be one. Repeating a token with an increment of zero can also be used to boost the scores of matches on that token.
Set it to values greater than one to inhibit exact phrase matches. If, for example, one does not want phrases to match across removed stop words, then one could build a stop word filter that removes stop words and also sets the increment to the number of stop words removed before each non-stop word. Then exact phrase queries will only match when the terms occur with no intervening stop words.
Lucene::PositionIncrementAttribute::PositionIncrementAttribute | ( | ) |
|
virtual |
|
inlinestatic |
|
virtual |
Clears the values in this Attribute and resets it to its default value. If this implementation implements more than one Attribute interface it clears all.
Implements Lucene::Attribute.
|
virtual |
Shallow clone. Subclasses must override this if they need to clone any members deeply.
base | clone reference - null when called initially, then set in top virtual override. |
Implements Lucene::Attribute.
|
virtual |
Copies the values from this Attribute into the passed-in target attribute. The target implementation must support all the Attributes this implementation supports.
Implements Lucene::Attribute.
|
virtual |
All values used for computation of hashCode()
should be checked here for equality.
see also LuceneObject#equals(Object)
Implements Lucene::Attribute.
|
inlinevirtual |
Reimplemented from Lucene::Attribute.
|
virtual |
Returns the position increment of this Token.
|
virtual |
Subclasses must implement this method and should compute a hashCode similar to this:
int32_t hashCode() { int32_t code = startOffset; code = code * 31 + endOffset; return code; }
see also equals(Object)
Implements Lucene::Attribute.
|
virtual |
Set the position increment. The default value is one.
positionIncrement | the distance from the prior term |
|
inline |
|
virtual |
Returns a string representation of the object.
Reimplemented from Lucene::LuceneObject.
|
protected |