This project has retired. For details please refer to its Attic page.
Lucy::Search::SortRule – C API Documentation
Apache Lucy™

Lucy::Search::SortRule

parcel Lucy
class variable LUCY_SORTRULE
struct symbol lucy_SortRule
class nickname lucy_SortRule
header file Lucy/Search/SortRule.h

Name

Lucy::Search::SortRule – Element of a SortSpec.

Description

SortRules are the building blocks used to assemble SortSpecs; each SortRule defines a single level of sorting. For example, sorting first by “category” then by score requires a SortSpec with two SortRule elements.

Functions

new
lucy_SortRule* // incremented
lucy_SortRule_new(
    int32_t type,
    cfish_String *field,
    bool reverse
);

Create a new SortRule.

type

Indicate whether to sort by score, field, etc. (The default is to sort by a field.)

field

The name of a sortable field.

reverse

If true, reverse the order of the sort for this rule.

init
lucy_SortRule* // incremented
lucy_SortRule_init(
    lucy_SortRule *self,
    int32_t type,
    cfish_String *field,
    bool reverse
);

Initialize a SortRule. See new() for a description of the parameters.

Methods

Get_Field
cfish_String*
lucy_SortRule_Get_Field(
    lucy_SortRule *self
);

Accessor for “field” member.

Get_Type
int32_t
lucy_SortRule_Get_Type(
    lucy_SortRule *self
);

Accessor for “type” member.

Get_Reverse
bool
lucy_SortRule_Get_Reverse(
    lucy_SortRule *self
);

Accessor for “reverse” member.

Inheritance

Lucy::Search::SortRule is a Clownfish::Obj.