CLucene - a full-featured, c++ search engine
API Documentation
#include <Sort.h>
Public Member Functions | |
virtual | ~SortField () |
LUCENE_STATIC_CONSTANT (int32_t, DOCSCORE=0) | |
Sort by document score (relevancy). | |
LUCENE_STATIC_CONSTANT (int32_t, DOC=1) | |
Sort by document number (index order). | |
LUCENE_STATIC_CONSTANT (int32_t, AUTO=2) | |
Guess type of sort based on field contents. | |
LUCENE_STATIC_CONSTANT (int32_t, STRING=3) | |
Sort using term values as Strings. | |
LUCENE_STATIC_CONSTANT (int32_t, INT=4) | |
Sort using term values as encoded Integers. | |
LUCENE_STATIC_CONSTANT (int32_t, FLOAT=5) | |
Sort using term values as encoded Floats. | |
LUCENE_STATIC_CONSTANT (int32_t, CUSTOM=9) | |
Sort using a custom Comparator. | |
SortField (const TCHAR *field) | |
Creates a sort by terms in the given field where the type of term value is determined dynamically (AUTO). | |
SortField (const TCHAR *field, int32_t type, bool reverse) | |
Creates a sort, possibly in reverse, by terms in the given field with the type of term values explicitly given. | |
SortField (const TCHAR *field, SortComparatorSource *comparator, bool reverse=false) | |
Creates a sort, possibly in reverse, with a custom comparison function. | |
const TCHAR * | getField () const |
Returns the name of the field. | |
SortField * | clone () const |
int32_t | getType () const |
Returns the type of contents in the field. | |
bool | getReverse () const |
Returns the Locale by which term values are interpreted. | |
SortComparatorSource * | getFactory () const |
TCHAR * | toString () const |
Static Public Attributes | |
static SortField * | FIELD_SCORE |
Represents sorting by document score (relevancy). | |
static SortField * | FIELD_DOC |
Represents sorting by document number (index order). | |
Protected Member Functions | |
SortField (const SortField &clone) |
Fields must be indexed in order to sort by them.
lucene::search::SortField::SortField | ( | const SortField & | clone | ) | [protected] |
virtual lucene::search::SortField::~SortField | ( | ) | [virtual] |
lucene::search::SortField::SortField | ( | const TCHAR * | field | ) |
Creates a sort by terms in the given field where the type of term value is determined dynamically (AUTO).
field | Name of field to sort by, cannot be null . |
lucene::search::SortField::SortField | ( | const TCHAR * | field, | |
int32_t | type, | |||
bool | reverse | |||
) |
Creates a sort, possibly in reverse, by terms in the given field with the type of term values explicitly given.
field | Name of field to sort by. Can be null if type is SCORE or DOC. | |
type | Type of values in the terms. | |
reverse | True if natural order should be reversed (default=false). |
lucene::search::SortField::SortField | ( | const TCHAR * | field, | |
SortComparatorSource * | comparator, | |||
bool | reverse = false | |||
) |
Creates a sort, possibly in reverse, with a custom comparison function.
field | Name of field to sort by; cannot be null . | |
comparator | Returns a comparator for sorting hits. | |
reverse | True if natural order should be reversed (default=false). |
lucene::search::SortField::LUCENE_STATIC_CONSTANT | ( | int32_t | , | |
DOCSCORE | = 0 | |||
) |
lucene::search::SortField::LUCENE_STATIC_CONSTANT | ( | int32_t | , | |
DOC | = 1 | |||
) |
lucene::search::SortField::LUCENE_STATIC_CONSTANT | ( | int32_t | , | |
AUTO | = 2 | |||
) |
Guess type of sort based on field contents.
A regular expression is used to look at the first term indexed for the field and determine if it represents an integer number, a floating point number, or just arbitrary string characters.
lucene::search::SortField::LUCENE_STATIC_CONSTANT | ( | int32_t | , | |
STRING | = 3 | |||
) |
lucene::search::SortField::LUCENE_STATIC_CONSTANT | ( | int32_t | , | |
INT | = 4 | |||
) |
lucene::search::SortField::LUCENE_STATIC_CONSTANT | ( | int32_t | , | |
FLOAT | = 5 | |||
) |
lucene::search::SortField::LUCENE_STATIC_CONSTANT | ( | int32_t | , | |
CUSTOM | = 9 | |||
) |
const TCHAR* lucene::search::SortField::getField | ( | ) | const [inline] |
Returns the name of the field.
Could return null
if the sort is by SCORE or DOC.
null
. SortField* lucene::search::SortField::clone | ( | ) | const |
int32_t lucene::search::SortField::getType | ( | ) | const [inline] |
Returns the type of contents in the field.
bool lucene::search::SortField::getReverse | ( | ) | const [inline] |
Returns the Locale by which term values are interpreted.
May return null
if no Locale was specified.
null
. Returns whether the sort should be reversed. True if natural order should be reversed.
SortComparatorSource* lucene::search::SortField::getFactory | ( | ) | const [inline] |
TCHAR* lucene::search::SortField::toString | ( | ) | const |
Represents sorting by document score (relevancy).