Lucene++ - a full-featured, c++ search engine
API Documentation
Go to the documentation of this file.
22 SortField(
const String& field, int32_t type,
bool reverse =
false);
36 SortField(
const String& field,
const std::locale& locale,
bool reverse =
false);
53 static const int32_t
DOC;
59 static const int32_t
INT;
localePtr getLocale()
Returns the Locale by which term values are interpreted.
static SortFieldPtr FIELD_SCORE()
Represents sorting by document score (relevancy).
static const int32_t SHORT
Sort using term values as Shorts. Sort values are Short and lower values are at the front.
Definition: SortField.h:71
static const int32_t BYTE
Sort using term values as Bytes. Sort values are Byte and lower values are at the front.
Definition: SortField.h:78
#define LUCENE_CLASS(Name)
Definition: LuceneObject.h:24
boost::shared_ptr< LuceneObject > LuceneObjectPtr
Definition: LuceneTypes.h:539
String getField()
Returns the name of the field. Could return null if the sort is by SCORE or DOC.
SortField(const String &field, int32_t type, bool reverse=false)
Creates a sort by terms in the given field with the type of term values explicitly given.
ParserPtr parser
Definition: SortField.h:90
boost::shared_ptr< SortField > SortFieldPtr
Definition: LuceneTypes.h:443
static const int32_t LONG
Sort using term values as Longs. Sort values are Long and lower values are at the front.
Definition: SortField.h:65
int32_t type
Definition: SortField.h:88
virtual bool equals(const LuceneObjectPtr &other)
Returns true if other is equal to this. If a FieldComparatorSource or Parser was provided,...
void initFieldType(const String &field, int32_t type)
Sets field and type, and ensures field is not NULL unless type is SCORE or DOC.
Definition: AbstractAllTermDocs.h:12
Base class for all Lucene classes.
Definition: LuceneObject.h:31
static const int32_t INT
Sort using term values as Integers. Sort values are Integer and lower values are at the front.
Definition: SortField.h:59
static const int32_t DOC
Sort by document number (index order). Sort values are Integer and lower values are at the front.
Definition: SortField.h:53
virtual String toString()
Returns a string representation of the object.
static const int32_t SCORE
Sort by document score (relevancy). Sort values are Double and higher values are at the front.
Definition: SortField.h:46
static const int32_t STRING_VAL
Sort using term values as Strings, but comparing by value (using String::compare) for all comparisons...
Definition: SortField.h:82
static const int32_t STRING
Sort using term values as Strings. Sort values are String and lower values are at the front.
Definition: SortField.h:56
FieldComparatorSourcePtr getComparatorSource()
Returns the FieldComparatorSource used for custom sorting.
FieldComparatorPtr getComparator(int32_t numHits, int32_t sortPos)
Returns the FieldComparator to use for sorting.
Stores information about how to sort documents by terms in an individual field. Fields must be indexe...
Definition: SortField.h:16
static const int32_t DOUBLE
Sort using term values as Doubles. Sort values are Double and lower values are at the front.
Definition: SortField.h:68
ParserPtr getParser()
Returns the instance of a FieldCache parser that fits to the given sort type. May return null if no p...
boost::shared_ptr< FieldComparatorSource > FieldComparatorSourcePtr
Definition: LuceneTypes.h:349
bool getReverse()
Returns whether the sort should be reversed.
boost::shared_ptr< Parser > ParserPtr
Definition: LuceneTypes.h:401
static const int32_t FLOAT
Sort using term values as Floats. Sort values are Float and lower values are at the front.
Definition: SortField.h:62
SortField(const String &field, const ParserPtr &parser, bool reverse=false)
Creates a sort, possibly in reverse, by terms in the given field, parsed to numeric values using a cu...
virtual int32_t hashCode()
Return hash code for this object.
static SortFieldPtr FIELD_DOC()
Represents sorting by document number (index order).
String field
Definition: SortField.h:87
SortField(const String &field, const FieldComparatorSourcePtr &comparator, bool reverse=false)
Creates a sort, possibly in reverse, with a custom comparison function.
localePtr locale
Definition: SortField.h:89
static const int32_t CUSTOM
Sort using a custom Comparator. Sort values are any ComparableValue and sorting is done according to ...
Definition: SortField.h:75
SortField(const String &field, const std::locale &locale, bool reverse=false)
Creates a sort, possibly in reverse, by terms in the given field sorted according to the given locale...
int32_t getType()
Returns the type of contents in the field.
boost::shared_ptr< FieldComparator > FieldComparatorPtr
Definition: LuceneTypes.h:348
clucene.sourceforge.net