Lucene++ - a full-featured, c++ search engine
API Documentation

- Main Page
- Related Pages
- Namespaces
- Data Structures
- Files

- Data Structures
- Class Hierarchy
- Data Fields

All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
Lucene::NearSpansUnordered Class Reference

Similar to NearSpansOrdered, but for the unordered case. More...

`#include <NearSpansUnordered.h>`

Inheritance diagram for Lucene::NearSpansUnordered:

## Public Member Functions

| NearSpansUnordered (SpanNearQueryPtr query, IndexReaderPtr reader)
virtual | ~NearSpansUnordered ()
virtual String | getClassName ()
boost::shared_ptr < NearSpansUnordered > | shared_from_this ()
virtual void | initialize ()
| Called directly after instantiation to create objects that depend on this object being fully constructed. More...
Collection< SpansPtr > | getSubSpans ()
virtual bool | next ()
| Move to the next match, returning true if any such exists. More...
virtual bool | skipTo (int32_t target)
| Skips to the first match beyond the current, whose document number is greater than or equal to target. More...
virtual int32_t | doc ()
| Returns the document number of the current match. Initially invalid. More...
virtual int32_t | start ()
| Returns the start position of the current match. Initially invalid. More...
virtual int32_t | end ()
| Returns the end position of the current match. Initially invalid. More...
virtual Collection< ByteArray > | getPayload ()

Returns the payload data for the current span. This is invalid until next() is called for the first time. This method must not be called more than once after each call of next(). However, most payloads are loaded lazily, so if the payload data for the current position is not needed, this method may not be called at all for performance reasons. An ordered SpanQuery does not lazy load, so if you have payloads in your index and you do not want ordered SpanNearQuerys to collect payloads, you can disable collection with a constructor option. More...

virtual bool | isPayloadAvailable ()
| Checks if a payload can be loaded at this position. More...
virtual String | toString ()
| Returns a string representation of the object. More...
Public Member Functions inherited from Lucene::Spans
virtual | ~Spans ()
boost::shared_ptr< Spans > | shared_from_this ()
Public Member Functions inherited from Lucene::LuceneObject
virtual | ~LuceneObject ()
virtual LuceneObjectPtr | clone (LuceneObjectPtr other=LuceneObjectPtr())
| Return clone of this object. More...
virtual int32_t | hashCode ()
| Return hash code for this object. More...
virtual bool | equals (LuceneObjectPtr other)
| Return whether two objects are equal. More...
virtual int32_t | compareTo (LuceneObjectPtr other)
| Compare two objects. More...
Public Member Functions inherited from Lucene::LuceneSync
virtual | ~LuceneSync ()
virtual SynchronizePtr | getSync ()
| Return this object synchronize lock. More...
virtual LuceneSignalPtr | getSignal ()
| Return this object signal. More...
virtual void | lock (int32_t timeout=0)
| Lock this object using an optional timeout. More...
virtual void | unlock ()
| Unlock this object. More...
virtual bool | holdsLock ()
| Returns true if this object is currently locked by current thread. More...
virtual void | wait (int32_t timeout=0)
| Wait for signal using an optional timeout. More...
virtual void | notifyAll ()
| Notify all threads waiting for signal. More...

## Static Public Member Functions

static String | _getClassName ()
Static Public Member Functions inherited from Lucene::Spans
static String | _getClassName ()

## Protected Member Functions

SpansCellPtr | min ()
void | initList (bool next)
void | addToList (SpansCellPtr cell)
void | firstToLast ()
void | queueToList ()
void | listToQueue ()
bool | atMatch ()

## Protected Attributes

SpanNearQueryPtr | query
IndexReaderPtr | reader
Collection< SpansCellPtr > | ordered
Collection< SpansPtr > | subSpans
int32_t | slop
SpansCellPtr | first
SpansCellPtr | last
int32_t | totalLength
CellQueuePtr | queue
SpansCellPtr | max
bool | more
bool | firstTime

## Detailed Description

Similar to NearSpansOrdered, but for the unordered case.

Only public for subclassing. Most implementations should not need this class

## Constructor & Destructor Documentation

Lucene::NearSpansUnordered::NearSpansUnordered | ( | SpanNearQueryPtr | query,
|  | IndexReaderPtr | reader
| ) |  |

virtual Lucene::NearSpansUnordered::~NearSpansUnordered | ( | ) |  |

virtual

## Member Function Documentation

static String Lucene::NearSpansUnordered::_getClassName | ( | ) |  |

inline static

void Lucene::NearSpansUnordered::addToList | ( | SpansCellPtr | cell) |  |

protected

bool Lucene::NearSpansUnordered::atMatch | ( | ) |  |

protected

virtual int32_t Lucene::NearSpansUnordered::doc | ( | ) |  |

virtual

Returns the document number of the current match. Initially invalid.

Implements Lucene::Spans.

virtual int32_t Lucene::NearSpansUnordered::end | ( | ) |  |

virtual

Returns the end position of the current match. Initially invalid.

Implements Lucene::Spans.

void Lucene::NearSpansUnordered::firstToLast | ( | ) |  |

protected

virtual String Lucene::NearSpansUnordered::getClassName | ( | ) |  |

inline virtual

Reimplemented from Lucene::Spans.

virtual Collection<ByteArray> Lucene::NearSpansUnordered::getPayload | ( | ) |  |

virtual

Returns the payload data for the current span. This is invalid until next() is called for the first time. This method must not be called more than once after each call of next(). However, most payloads are loaded lazily, so if the payload data for the current position is not needed, this method may not be called at all for performance reasons. An ordered SpanQuery does not lazy load, so if you have payloads in your index and you do not want ordered SpanNearQuerys to collect payloads, you can disable collection with a constructor option.

Note that the return type is a collection, thus the ordering should not be relied upon.

Returns
  a List of byte arrays containing the data of this payload, otherwise null if isPayloadAvailable is false

Implements Lucene::Spans.

Collection<SpansPtr> Lucene::NearSpansUnordered::getSubSpans | ( | ) |  |

virtual void Lucene::NearSpansUnordered::initialize | ( | ) |  |

virtual

Called directly after instantiation to create objects that depend on this object being fully constructed.

Reimplemented from Lucene::LuceneObject.

void Lucene::NearSpansUnordered::initList | ( | bool | next) |  |

protected

virtual bool Lucene::NearSpansUnordered::isPayloadAvailable | ( | ) |  |

virtual

Checks if a payload can be loaded at this position.

Payloads can only be loaded once per call to next().

Returns
  true if there is a payload available at this position that can be loaded

Implements Lucene::Spans.

void Lucene::NearSpansUnordered::listToQueue | ( | ) |  |

protected

SpansCellPtr Lucene::NearSpansUnordered::min | ( | ) |  |

protected

virtual bool Lucene::NearSpansUnordered::next | ( | ) |  |

virtual

Move to the next match, returning true if any such exists.

Implements Lucene::Spans.

void Lucene::NearSpansUnordered::queueToList | ( | ) |  |

protected

boost::shared_ptr< NearSpansUnordered > Lucene::NearSpansUnordered::shared_from_this | ( | ) |  |

inline

virtual bool Lucene::NearSpansUnordered::skipTo | ( | int32_t | target) |  |

virtual

Skips to the first match beyond the current, whose document number is greater than or equal to target.

Returns true if there is such a match.

Behaves as if written:

    bool skipTo(int32_t target)
    {
        do
        {
            if (!next())
                return false;
        }
        while (target > doc());
        return true;
    }

Most implementations are considerably more efficient than that.

Implements Lucene::Spans.

virtual int32_t Lucene::NearSpansUnordered::start | ( | ) |  |

virtual

Returns the start position of the current match. Initially invalid.

Implements Lucene::Spans.

virtual String Lucene::NearSpansUnordered::toString | ( | ) |  |

virtual

Returns a string representation of the object.

Reimplemented from Lucene::LuceneObject.

## Field Documentation

SpansCellPtr Lucene::NearSpansUnordered::first

protected

bool Lucene::NearSpansUnordered::firstTime

protected

SpansCellPtr Lucene::NearSpansUnordered::last

protected

SpansCellPtr Lucene::NearSpansUnordered::max

protected

bool Lucene::NearSpansUnordered::more

protected

Collection<SpansCellPtr> Lucene::NearSpansUnordered::ordered

protected

SpanNearQueryPtr Lucene::NearSpansUnordered::query

protected

CellQueuePtr Lucene::NearSpansUnordered::queue

protected

IndexReaderPtr Lucene::NearSpansUnordered::reader

protected

int32_t Lucene::NearSpansUnordered::slop

protected

Collection<SpansPtr> Lucene::NearSpansUnordered::subSpans

protected

int32_t Lucene::NearSpansUnordered::totalLength

protected

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

- NearSpansUnordered.h

clucene.sourceforge.net