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

Lucy::Search::Matcher

parcel Lucy
class variable LUCY_MATCHER
struct symbol lucy_Matcher
class nickname lucy_Matcher
header file Lucy/Search/Matcher.h

Name

Lucy::Search::Matcher – Match a set of document ids.

Description

A Matcher iterates over a set of ascending document ids. Some Matchers implement Score() and can assign relevance scores to the docs that they match. Other implementations may be match-only.

Functions

init
lucy_Matcher*
lucy_Matcher_init(
    lucy_Matcher *self
);

Abstract initializer.

Methods

Next (abstract)
int32_t
lucy_Matcher_Next(
    lucy_Matcher *self
);

Proceed to the next doc id.

Returns: A positive doc id, or 0 once the iterator is exhausted.

Advance
int32_t
lucy_Matcher_Advance(
    lucy_Matcher *self,
    int32_t target
);

Advance the iterator to the first doc id greater than or equal to target. The default implementation simply calls Next() over and over, but subclasses have the option of doing something more efficient.

target

A positive doc id, which must be greater than the current doc id once the iterator has been initialized.

Returns: A positive doc id, or 0 once the iterator is exhausted.

Get_Doc_ID (abstract)
int32_t
lucy_Matcher_Get_Doc_ID(
    lucy_Matcher *self
);

Return the current doc id. Valid only after a successful call to Next() or Advance() and must not be called otherwise.

Score (abstract)
float
lucy_Matcher_Score(
    lucy_Matcher *self
);

Return the score of the current document.

Only Matchers which are used for scored search need implement Score().

Inheritance

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