parcel | Lucy |
class variable | LUCY_POLYREADER |
struct symbol | lucy_PolyReader |
class nickname | lucy_PolyReader |
header file | Lucy/Index/PolyReader.h |
Lucy::Index::PolyReader – Multi-segment implementation of IndexReader.
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.
lucy_PolyReader* // incremented
lucy_PolyReader_open(
cfish_Obj *index,
lucy_Snapshot *snapshot,
lucy_IndexManager *manager
);
Create and open a PolyReader.
Either a string filepath or a Folder.
A Snapshot. If not supplied, the most recent snapshot file will be used.
An IndexManager. Read-locking is off by default; supplying this argument turns it on.
lucy_PolyReader*
lucy_PolyReader_do_open(
lucy_PolyReader *self,
cfish_Obj *index,
lucy_Snapshot *snapshot,
lucy_IndexManager *manager
);
Initialize and open a PolyReader.
Either a string filepath or a Folder.
A Snapshot. If not supplied, the most recent snapshot file will be used.
An IndexManager. Read-locking is off by default; supplying this argument turns it on.
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.
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.
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.
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.
cfish_Vector* // incremented
lucy_PolyReader_Seg_Readers(
lucy_PolyReader *self
);
Return an array of all the SegReaders represented within the IndexReader.
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.
The name of the DataReader subclass that the desired component must implement.
lucy_DataReader*
lucy_PolyReader_Fetch(
lucy_PolyReader *self,
cfish_String *api
);
Fetch a component, or return NULL if the component can’t be found.
The name of the DataReader subclass that the desired component must implement.
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.
An array of DataReaders.
Doc id start offsets for each reader.
lucy_Schema*
lucy_PolyReader_Get_Schema(
lucy_PolyReader *self
);
Accessor for “schema” member var.
lucy_Folder*
lucy_PolyReader_Get_Folder(
lucy_PolyReader *self
);
Accessor for “folder” member var.
lucy_Snapshot*
lucy_PolyReader_Get_Snapshot(
lucy_PolyReader *self
);
Accessor for “snapshot” member var.
cfish_Vector*
lucy_PolyReader_Get_Segments(
lucy_PolyReader *self
);
Accessor for “segments” member var.
lucy_Segment*
lucy_PolyReader_Get_Segment(
lucy_PolyReader *self
);
Accessor for “segment” member var.
int32_t
lucy_PolyReader_Get_Seg_Tick(
lucy_PolyReader *self
);
Accessor for “seg_tick” member var.
Lucy::Index::PolyReader is a Lucy::Index::IndexReader is a Lucy::Index::DataReader is a Clownfish::Obj.
Copyright © 2010-2015 The Apache Software Foundation, Licensed under the
Apache License, Version 2.0.
Apache Lucy, Lucy, Apache, the Apache feather logo, and the Apache Lucy project logo are trademarks of The
Apache Software Foundation. All other marks mentioned may be trademarks or registered trademarks of their
respective owners.