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

Lucy::Index::Lexicon

parcel Lucy
class variable LUCY_LEXICON
struct symbol lucy_Lexicon
class nickname lucy_Lex
header file Lucy/Index/Lexicon.h

Name

Lucy::Index::Lexicon – Iterator for a field’s terms.

Description

A Lexicon is an iterator which provides access to all the unique terms for a given field in sorted order.

If an index consists of two documents with a ‘content’ field holding “three blind mice” and “three musketeers” respectively, then iterating through the ‘content’ field’s lexicon would produce this list:

blind
mice
musketeers
three

Methods

Seek (abstract)
void
lucy_Lex_Seek(
    lucy_Lexicon *self,
    cfish_Obj *target
);

Seek the Lexicon to the first iterator state which is greater than or equal to target. If target is NULL, reset the iterator.

Next (abstract)
bool
lucy_Lex_Next(
    lucy_Lexicon *self
);

Proceed to the next term.

Returns: true until the iterator is exhausted, then false.

Reset (abstract)
void
lucy_Lex_Reset(
    lucy_Lexicon *self
);

Reset the iterator. Next() must be called to proceed to the first element.

Get_Term (abstract)
cfish_Obj*
lucy_Lex_Get_Term(
    lucy_Lexicon *self
);

Return the current term, or NULL if the iterator is not in a valid state.

Inheritance

Lucy::Index::Lexicon is a Clownfish::Obj.