parcel | Lucy |
class variable | LUCY_INDEXREADER |
struct symbol | lucy_IndexReader |
class nickname | lucy_IxReader |
header file | Lucy/Index/IndexReader.h |
Lucy::Index::IndexReader – Read from an inverted index.
IndexReader is the interface through which IndexSearcher objects access the content of an index.
IndexReader objects always represent a point-in-time view of an index as it existed at the moment the reader was created. If you want search results to reflect modifications to an index, you must create a new IndexReader after the update process completes.
IndexReaders are composites; most of the work is done by individual DataReader sub-components, which may be accessed via Fetch() and Obtain(). The most efficient and powerful access to index data happens at the segment level via SegReader’s sub-components.
lucy_IndexReader* // incremented
lucy_IxReader_open(
cfish_Obj *index,
lucy_Snapshot *snapshot,
lucy_IndexManager *manager
);
IndexReader is an abstract base class; open() returns the IndexReader subclass PolyReader, which channels the output of 0 or more SegReaders.
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_IndexReader*
lucy_IxReader_do_open(
lucy_IndexReader *self,
cfish_Obj *index,
lucy_Snapshot *snapshot,
lucy_IndexManager *manager
);
Initialize and open an IndexReader.
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_IxReader_Doc_Max(
lucy_IndexReader *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_IxReader_Doc_Count(
lucy_IndexReader *self
);
Return the number of documents available to the reader, subtracting any that are marked as deleted.
int32_t
lucy_IxReader_Del_Count(
lucy_IndexReader *self
);
Return the number of documents which have been marked as deleted but not yet purged from the index.
lucy_I32Array* // incremented
lucy_IxReader_Offsets(
lucy_IndexReader *self
);
Return an array with one entry for each segment, corresponding to segment doc_id start offset.
cfish_Vector* // incremented
lucy_IxReader_Seg_Readers(
lucy_IndexReader *self
);
Return an array of all the SegReaders represented within the IndexReader.
lucy_DataReader*
lucy_IxReader_Obtain(
lucy_IndexReader *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_IxReader_Fetch(
lucy_IndexReader *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_IxReader_Aggregator(
lucy_IndexReader *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_IxReader_Get_Schema(
lucy_IndexReader *self
);
Accessor for “schema” member var.
lucy_Folder*
lucy_IxReader_Get_Folder(
lucy_IndexReader *self
);
Accessor for “folder” member var.
lucy_Snapshot*
lucy_IxReader_Get_Snapshot(
lucy_IndexReader *self
);
Accessor for “snapshot” member var.
cfish_Vector*
lucy_IxReader_Get_Segments(
lucy_IndexReader *self
);
Accessor for “segments” member var.
lucy_Segment*
lucy_IxReader_Get_Segment(
lucy_IndexReader *self
);
Accessor for “segment” member var.
int32_t
lucy_IxReader_Get_Seg_Tick(
lucy_IndexReader *self
);
Accessor for “seg_tick” member var.
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.