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

Lucy::Search::RangeQuery

parcel Lucy
class variable LUCY_RANGEQUERY
struct symbol lucy_RangeQuery
class nickname lucy_RangeQuery
header file Lucy/Search/RangeQuery.h

Name

Lucy::Search::RangeQuery – Match a range of values.

Description

RangeQuery matches documents where the value for a particular field falls within a given range.

Functions

new
lucy_RangeQuery* // incremented
lucy_RangeQuery_new(
    cfish_String *field,
    cfish_Obj *lower_term,
    cfish_Obj *upper_term,
    bool include_lower,
    bool include_upper
);

Create a new RangeQuery.

Takes 5 parameters; field is required, as is at least one of either lower_term or upper_term.

field

The name of a sortable field.

lower_term

Lower delimiter. If not supplied, all values less than upper_term will pass.

upper_term

Upper delimiter. If not supplied, all values greater than lower_term will pass.

include_lower

Indicates whether docs which match lower_term should be included in the results.

include_upper

Indicates whether docs which match upper_term should be included in the results.

init
lucy_RangeQuery*
lucy_RangeQuery_init(
    lucy_RangeQuery *self,
    cfish_String *field,
    cfish_Obj *lower_term,
    cfish_Obj *upper_term,
    bool include_lower,
    bool include_upper
);

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

Methods

Equals
bool
lucy_RangeQuery_Equals(
    lucy_RangeQuery *self,
    cfish_Obj *other
);

Indicate whether two objects are the same. By default, compares the memory address.

other

Another Obj.

To_String
cfish_String* // incremented
lucy_RangeQuery_To_String(
    lucy_RangeQuery *self
);

Generic stringification: “ClassName@hex_mem_address”.

Make_Compiler
lucy_Compiler* // incremented
lucy_RangeQuery_Make_Compiler(
    lucy_RangeQuery *self,
    lucy_Searcher *searcher,
    float boost,
    bool subordinate
);

Abstract factory method returning a Compiler derived from this Query.

searcher

A Searcher.

boost

A scoring multiplier.

subordinate

Indicates whether the Query is a subquery (as opposed to a top-level query). If false, the implementation must invoke Normalize() on the newly minted Compiler object before returning it.

Dump
cfish_Obj* // incremented
lucy_RangeQuery_Dump(
    lucy_RangeQuery *self
);
Load
cfish_Obj* // incremented
lucy_RangeQuery_Load(
    lucy_RangeQuery *self,
    cfish_Obj *dump
);

Methods inherited from Lucy::Search::Query

Set_Boost
void
lucy_RangeQuery_Set_Boost(
    lucy_RangeQuery *self,
    float boost
);

Set the Query’s boost.

Get_Boost
float
lucy_RangeQuery_Get_Boost(
    lucy_RangeQuery *self
);

Get the Query’s boost.

Inheritance

Lucy::Search::RangeQuery is a Lucy::Search::Query is a Clownfish::Obj.