CLucene - a full-featured, c++ search engine
API Documentation
#include <Sort.h>
Public Member Functions | |
virtual | ~ScoreDocComparator () |
virtual int32_t | compare (struct ScoreDoc *i, struct ScoreDoc *j)=0 |
Compares two ScoreDoc objects and returns a result indicating their sort order. | |
virtual lucene::util::Comparable * | sortValue (struct ScoreDoc *i)=0 |
Returns the value used to sort the given document. | |
virtual int32_t | sortType ()=0 |
Returns the type of sort. | |
Static Public Attributes | |
static ScoreDocComparator * | RELEVANCE |
Special comparator for sorting hits according to computed relevance (document score). | |
static ScoreDocComparator * | INDEXORDER |
Special comparator for sorting hits according to index order (document number). | |
Protected Member Functions | |
ScoreDocComparator () |
lucene::search::ScoreDocComparator::ScoreDocComparator | ( | ) | [inline, protected] |
virtual lucene::search::ScoreDocComparator::~ScoreDocComparator | ( | ) | [virtual] |
virtual int32_t lucene::search::ScoreDocComparator::compare | ( | struct ScoreDoc * | i, | |
struct ScoreDoc * | j | |||
) | [pure virtual] |
Compares two ScoreDoc objects and returns a result indicating their sort order.
-1
if i
should come before j
1
if i
should come after j
0
if they are equal Implemented in lucene::search::ScoreDocComparators::Relevance, lucene::search::ScoreDocComparators::IndexOrder, lucene::search::ScoreDocComparators::String, lucene::search::ScoreDocComparators::Int32, and lucene::search::ScoreDocComparators::Float.
virtual lucene:: util ::Comparable* lucene::search::ScoreDocComparator::sortValue | ( | struct ScoreDoc * | i | ) | [pure virtual] |
Returns the value used to sort the given document.
The object returned must implement the java.io.Serializable interface. This is used by multisearchers to determine how to collate results from their searchers.
i | Document |
Implemented in lucene::search::ScoreDocComparators::Relevance, lucene::search::ScoreDocComparators::IndexOrder, lucene::search::ScoreDocComparators::String, lucene::search::ScoreDocComparators::Int32, and lucene::search::ScoreDocComparators::Float.
virtual int32_t lucene::search::ScoreDocComparator::sortType | ( | ) | [pure virtual] |
Returns the type of sort.
Should return SortField.SCORE
, SortField.DOC
, SortField.STRING
, SortField.INTEGER
, SortField::FLOAT
or SortField.CUSTOM
. It is not valid to return SortField.AUTO
. This is used by multisearchers to determine how to collate results from their searchers.
Implemented in lucene::search::ScoreDocComparators::Relevance, lucene::search::ScoreDocComparators::IndexOrder, lucene::search::ScoreDocComparators::String, lucene::search::ScoreDocComparators::Int32, and lucene::search::ScoreDocComparators::Float.
Special comparator for sorting hits according to computed relevance (document score).