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


Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Data Fields | Protected Member Functions
Lucene::FieldDocSortedHitQueue Class Reference

Collects sorted results from Searchable's and collates them. The elements put into this queue must be of type FieldDoc. More...

#include <FieldDocSortedHitQueue.h>

+ Inheritance diagram for Lucene::FieldDocSortedHitQueue:

Public Member Functions

 FieldDocSortedHitQueue (int32_t size)
 
virtual ~FieldDocSortedHitQueue ()
 
virtual String getClassName ()
 
boost::shared_ptr< FieldDocSortedHitQueueshared_from_this ()
 
void setFields (Collection< SortFieldPtr > fields)
 Allows redefinition of sort fields if they are null. This is to handle the case using ParallelMultiSearcher where the original list contains AUTO and we don't know the actual sort type until the values come back. The fields can only be set once. This method should be synchronized external like all other PQ methods.
 
Collection< SortFieldPtrgetFields ()
 Returns the fields being used to sort.
 
- Public Member Functions inherited from Lucene::PriorityQueue< FieldDocPtr >
 PriorityQueue (int32_t maxSize)
 
virtual ~PriorityQueue ()
 
virtual void initialize ()
 Called directly after instantiation to create objects that depend on this object being fully constructed.
 
int32_t maxSize ()
 Return maximum size of queue.
 
FieldDocPtr add (const FieldDocPtr &type)
 Adds an Object to a PriorityQueue in log(size) time. If one tries to add more objects than maxSize from initialize an IndexOutOfBoundsException is thrown.
 
FieldDocPtr addOverflow (const FieldDocPtr &type)
 Adds an Object to a PriorityQueue in log(size) time. It returns the object (if any) that was dropped off the heap because it was full. This can be the given parameter (in case it is smaller than the full heap's minimum, and couldn't be added), or another object that was previously the smallest value in the heap and now has been replaced by a larger one, or null if the queue wasn't yet full with maxSize elements.
 
FieldDocPtr top ()
 Returns the least element of the PriorityQueue.
 
FieldDocPtr pop ()
 Removes and returns the least element of the PriorityQueue.
 
FieldDocPtr updateTop ()
 Should be called when the Object at top changes values.
 
int32_t size () const
 Returns the number of elements currently stored in the PriorityQueue.
 
bool empty () const
 Returns whether PriorityQueue is currently empty.
 
void clear ()
 Removes all entries from the PriorityQueue.
 
- Public Member Functions inherited from Lucene::LuceneObject
virtual ~LuceneObject ()
 
virtual LuceneObjectPtr clone (const LuceneObjectPtr &other=LuceneObjectPtr())
 Return clone of this object.
 
virtual int32_t hashCode ()
 Return hash code for this object.
 
virtual bool equals (const LuceneObjectPtr &other)
 Return whether two objects are equal.
 
virtual int32_t compareTo (const LuceneObjectPtr &other)
 Compare two objects.
 
virtual String toString ()
 Returns a string representation of the object.
 
- Public Member Functions inherited from Lucene::LuceneSync
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 ()
 

Data Fields

Collection< SortFieldPtrfields
 
Collection< CollatorPtrcollators
 

Protected Member Functions

Collection< CollatorPtrhasCollators (Collection< SortFieldPtr > fields)
 Returns an array of collators, possibly null. The collators correspond to any SortFields which were given a specific locale.
 
virtual bool lessThan (const FieldDocPtr &first, const FieldDocPtr &second)
 Returns whether first is less relevant than second.
 
- Protected Member Functions inherited from Lucene::PriorityQueue< FieldDocPtr >
void upHeap ()
 
void downHeap ()
 
virtual FieldDocPtr getSentinelObject ()
 This method can be overridden by extending classes to return a sentinel object which will be used by initialize to fill the queue, so that the code which uses that queue can always assume it's full and only change the top without attempting to insert any new object.
 
- Protected Member Functions inherited from Lucene::LuceneObject
 LuceneObject ()
 

Additional Inherited Members

- Public Types inherited from Lucene::PriorityQueue< FieldDocPtr >
typedef std::vector< FieldDocPtrheap_type
 
- Protected Attributes inherited from Lucene::PriorityQueue< FieldDocPtr >
heap_type heap
 
int32_t _size
 
int32_t _maxSize
 
- Protected Attributes inherited from Lucene::LuceneSync
SynchronizePtr objectLock
 
LuceneSignalPtr objectSignal
 

Detailed Description

Collects sorted results from Searchable's and collates them. The elements put into this queue must be of type FieldDoc.

Constructor & Destructor Documentation

◆ FieldDocSortedHitQueue()

Lucene::FieldDocSortedHitQueue::FieldDocSortedHitQueue ( int32_t  size)

◆ ~FieldDocSortedHitQueue()

virtual Lucene::FieldDocSortedHitQueue::~FieldDocSortedHitQueue ( )
virtual

Member Function Documentation

◆ _getClassName()

static String Lucene::FieldDocSortedHitQueue::_getClassName ( )
inlinestatic

◆ getClassName()

virtual String Lucene::FieldDocSortedHitQueue::getClassName ( )
inlinevirtual

◆ getFields()

Collection< SortFieldPtr > Lucene::FieldDocSortedHitQueue::getFields ( )

Returns the fields being used to sort.

◆ hasCollators()

Collection< CollatorPtr > Lucene::FieldDocSortedHitQueue::hasCollators ( Collection< SortFieldPtr fields)
protected

Returns an array of collators, possibly null. The collators correspond to any SortFields which were given a specific locale.

Parameters
fieldsArray of sort fields.
Returns
Array, possibly null.

◆ lessThan()

virtual bool Lucene::FieldDocSortedHitQueue::lessThan ( const FieldDocPtr first,
const FieldDocPtr second 
)
protectedvirtual

Returns whether first is less relevant than second.

Reimplemented from Lucene::PriorityQueue< FieldDocPtr >.

◆ setFields()

void Lucene::FieldDocSortedHitQueue::setFields ( Collection< SortFieldPtr fields)

Allows redefinition of sort fields if they are null. This is to handle the case using ParallelMultiSearcher where the original list contains AUTO and we don't know the actual sort type until the values come back. The fields can only be set once. This method should be synchronized external like all other PQ methods.

◆ shared_from_this()

boost::shared_ptr< FieldDocSortedHitQueue > Lucene::FieldDocSortedHitQueue::shared_from_this ( )
inline

Field Documentation

◆ collators

Collection<CollatorPtr> Lucene::FieldDocSortedHitQueue::collators

◆ fields

Collection<SortFieldPtr> Lucene::FieldDocSortedHitQueue::fields

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

clucene.sourceforge.net