Struct tantivy::IndexWriter [] [src]

pub struct IndexWriter { /* fields omitted */ }

IndexWriter is the user entry-point to add document to an index.

It manages a small number of indexing thread, as well as a shared indexing queue. Each indexing thread builds its own independant Segment, via a SegmentWriter object.

Methods

impl IndexWriter
[src]

The index writer

Accessor to the merge policy.

Set the merge policy.

Detects and removes the files that are not used by the index anymore.

Merges a given list of segments

Rollback to the last commit

This cancels all of the update that happened before after the last commit. After calling rollback, the index is in the same state as it was after the last commit.

The opstamp at the last commit is returned.

Commits all of the pending changes

A call to commit blocks. After it returns, all of the document that were added since the last commit are published and persisted.

In case of a crash or an hardware failure (as long as the hard disk is spared), it will be possible to resume indexing from this point.

Commit returns the opstamp of the last document that made it in the commit.

Delete all documents containing a given term.

Delete operation only affects documents that were added in previous commits, and documents that were added previously in the same commit.

Like adds, the deletion itself will be visible only after calling commit().

Returns the opstamp of the last successful commit.

This is, for instance, the opstamp the index will rollback to if there is a failure like a power surge.

This is also the opstamp of the commit that is currently available for searchers.

Adds a document.

If the indexing pipeline is full, this call may block.

The opstamp is an increasing u64 that can be used by the client to align commits with its own document queue.

Currently it represents the number of documents that have been added since the creation of the index.

Trait Implementations

impl !Send for IndexWriter
[src]

impl !Sync for IndexWriter
[src]