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

Lucy::Index::PolyReader

parcel Lucy
class variable LUCY_POLYREADER
struct symbol lucy_PolyReader
class nickname lucy_PolyReader
header file Lucy/Index/PolyReader.h

Name

Lucy::Index::PolyReader – Multi-segment implementation of IndexReader.

Description

PolyReader conflates index data from multiple segments. For instance, if an index contains three segments with 10 documents each, PolyReader’s Doc_Max() method will return 30.

Some of PolyReader’s DataReader components may be less efficient or complete than the single-segment implementations accessed via SegReader.

Functions

open
lucy_PolyReader* // incremented
lucy_PolyReader_open(
    cfish_Obj *index,
    lucy_Snapshot *snapshot,
    lucy_IndexManager *manager
);

Create and open a PolyReader.

index

Either a string filepath or a Folder.

snapshot

A Snapshot. If not supplied, the most recent snapshot file will be used.

manager

An IndexManager. Read-locking is off by default; supplying this argument turns it on.

do_open
lucy_PolyReader*
lucy_PolyReader_do_open(
    lucy_PolyReader *self,
    cfish_Obj *index,
    lucy_Snapshot *snapshot,
    lucy_IndexManager *manager
);

Initialize and open a PolyReader.

index

Either a string filepath or a Folder.

snapshot

A Snapshot. If not supplied, the most recent snapshot file will be used.

manager

An IndexManager. Read-locking is off by default; supplying this argument turns it on.

Methods

Doc_Max
int32_t
lucy_PolyReader_Doc_Max(
    lucy_PolyReader *self
);

Return the maximum number of documents available to the reader, which is also the highest possible internal document id. Documents which have been marked as deleted but not yet purged from the index are included in this count.

Doc_Count
int32_t
lucy_PolyReader_Doc_Count(
    lucy_PolyReader *self
);

Return the number of documents available to the reader, subtracting any that are marked as deleted.

Del_Count
int32_t
lucy_PolyReader_Del_Count(
    lucy_PolyReader *self
);

Return the number of documents which have been marked as deleted but not yet purged from the index.

Offsets
lucy_I32Array* // incremented
lucy_PolyReader_Offsets(
    lucy_PolyReader *self
);

Return an array with one entry for each segment, corresponding to segment doc_id start offset.

Seg_Readers
cfish_Vector* // incremented
lucy_PolyReader_Seg_Readers(
    lucy_PolyReader *self
);

Return an array of all the SegReaders represented within the IndexReader.

Methods inherited from Lucy::Index::IndexReader

Obtain
lucy_DataReader*
lucy_PolyReader_Obtain(
    lucy_PolyReader *self,
    cfish_String *api
);

Fetch a component, or throw an error if the component can’t be found.

api

The name of the DataReader subclass that the desired component must implement.

Fetch
lucy_DataReader*
lucy_PolyReader_Fetch(
    lucy_PolyReader *self,
    cfish_String *api
);

Fetch a component, or return NULL if the component can’t be found.

api

The name of the DataReader subclass that the desired component must implement.

Methods inherited from Lucy::Index::DataReader

Aggregator (abstract)
lucy_DataReader* // incremented
lucy_PolyReader_Aggregator(
    lucy_PolyReader *self,
    cfish_Vector *readers,
    lucy_I32Array *offsets
);

Create a reader which aggregates the output of several lower level readers. Return NULL if such a reader is not valid.

readers

An array of DataReaders.

offsets

Doc id start offsets for each reader.

Get_Schema
lucy_Schema*
lucy_PolyReader_Get_Schema(
    lucy_PolyReader *self
);

Accessor for “schema” member var.

Get_Folder
lucy_Folder*
lucy_PolyReader_Get_Folder(
    lucy_PolyReader *self
);

Accessor for “folder” member var.

Get_Snapshot
lucy_Snapshot*
lucy_PolyReader_Get_Snapshot(
    lucy_PolyReader *self
);

Accessor for “snapshot” member var.

Get_Segments
cfish_Vector*
lucy_PolyReader_Get_Segments(
    lucy_PolyReader *self
);

Accessor for “segments” member var.

Get_Segment
lucy_Segment*
lucy_PolyReader_Get_Segment(
    lucy_PolyReader *self
);

Accessor for “segment” member var.

Get_Seg_Tick
int32_t
lucy_PolyReader_Get_Seg_Tick(
    lucy_PolyReader *self
);

Accessor for “seg_tick” member var.

Inheritance

Lucy::Index::PolyReader is a Lucy::Index::IndexReader is a Lucy::Index::DataReader is a Clownfish::Obj.