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

Lucy::Index::IndexManager

parcel Lucy
class variable LUCY_INDEXMANAGER
struct symbol lucy_IndexManager
class nickname lucy_IxManager
header file Lucy/Index/IndexManager.h

Name

Lucy::Index::IndexManager – Policies governing index updating, locking, and file deletion.

Description

IndexManager is an advanced-use class for controlling index locking, updating, merging, and deletion behaviors.

IndexManager and Architecture are complementary classes: Architecture is used to define traits and behaviors which cannot change for the life of an index; IndexManager is used for defining rules which may change from process to process.

Functions

new
lucy_IndexManager* // incremented
lucy_IxManager_new(
    cfish_String *host,
    lucy_LockFactory *lock_factory
);

Create a new IndexManager.

host

An identifier which should be unique per-machine.

lock_factory

A LockFactory.

init
lucy_IndexManager*
lucy_IxManager_init(
    lucy_IndexManager *self,
    cfish_String *host,
    lucy_LockFactory *lock_factory
);

Initialize an IndexManager.

host

An identifier which should be unique per-machine.

lock_factory

A LockFactory.

Methods

Set_Folder
void
lucy_IxManager_Set_Folder(
    lucy_IndexManager *self,
    lucy_Folder *folder
);

Setter for folder member. Typical clients (Indexer, IndexReader) will use this method to install their own Folder instance.

Get_Folder
lucy_Folder*
lucy_IxManager_Get_Folder(
    lucy_IndexManager *self
);

Getter for folder member.

Get_Host
cfish_String*
lucy_IxManager_Get_Host(
    lucy_IndexManager *self
);

Getter for host member.

Recycle
cfish_Vector* // incremented
lucy_IxManager_Recycle(
    lucy_IndexManager *self,
    lucy_PolyReader *reader,
    lucy_DeletionsWriter *del_writer,
    int64_t cutoff,
    bool optimize
);

Return an array of SegReaders representing segments that should be consolidated. Implementations must balance index-time churn against search-time degradation due to segment proliferation. The default implementation prefers small segments or segments with a high proportion of deletions.

reader

A PolyReader.

del_writer

A DeletionsWriter.

cutoff

A segment number which all returned SegReaders must exceed.

optimize

A boolean indicating whether to spend extra time optimizing the index for search-time performance.

Make_Write_Lock
lucy_Lock* // incremented
lucy_IxManager_Make_Write_Lock(
    lucy_IndexManager *self
);

Create the Lock which controls access to modifying the logical content of the index.

Set_Write_Lock_Timeout
void
lucy_IxManager_Set_Write_Lock_Timeout(
    lucy_IndexManager *self,
    uint32_t timeout
);

Setter for write lock timeout. Default: 1000 milliseconds.

Get_Write_Lock_Timeout
uint32_t
lucy_IxManager_Get_Write_Lock_Timeout(
    lucy_IndexManager *self
);

Getter for write lock timeout.

Set_Write_Lock_Interval
void
lucy_IxManager_Set_Write_Lock_Interval(
    lucy_IndexManager *self,
    uint32_t timeout
);

Setter for write lock retry interval. Default: 100 milliseconds.

Get_Write_Lock_Interval
uint32_t
lucy_IxManager_Get_Write_Lock_Interval(
    lucy_IndexManager *self
);

Getter for write lock retry interval.

Inheritance

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