Struct tantivy::Index [] [src]

pub struct Index { /* fields omitted */ }

Search Index

Methods

impl Index
[src]

[src]

Creates a new index using the RAMDirectory.

The index will be allocated in anonymous memory. This should only be used for unit tests.

[src]

Creates a new index in a given filepath. The index will use the MMapDirectory.

If a previous index was in this directory, then its meta file will be destroyed.

[src]

Accessor for the tokenizer manager.

[src]

Creates a new index in a temp directory.

The index will use the MMapDirectory in a newly created directory. The temp directory will be destroyed automatically when the Index object is destroyed.

The temp directory is only used for testing the MmapDirectory. For other unit tests, prefer the RAMDirectory, see: create_in_ram.

[src]

Create a new index from a directory.

[src]

Opens a new directory from an index path.

[src]

Reads the index meta file from the directory.

[src]

Open a new index writer. Attempts to acquire a lockfile.

The lockfile should be deleted on drop, but it is possible that due to a panic or other error, a stale lockfile will be left in the index directory. If you are sure that no other IndexWriter on the system is accessing the index directory, it is safe to manually delete the lockfile.

num_threads specifies the number of indexing workers that should work at the same time.

Errors

If the lockfile already exists, returns Error::FileAlreadyExists.

Panics

If the heap size per thread is too small, panics.

[src]

Creates a multithreaded writer It just calls writer_with_num_threads with the number of cores as num_threads

Errors

If the lockfile already exists, returns Error::FileAlreadyExists.

Panics

If the heap size per thread is too small, panics.

[src]

Accessor to the index schema

The schema is actually cloned.

[src]

Returns the list of segments that are searchable

[src]

Creates a new segment.

[src]

Return a reference to the index directory.

[src]

Return a mutable reference to the index directory.

[src]

Reads the meta.json and returns the list of SegmentMeta from the last commit.

[src]

Returns the list of segment ids that are searchable.

[src]

Creates a new generation of searchers after a change of the set of searchable indexes.

This needs to be called when a new segment has been published or after a merge.

[src]

Returns a searcher

This method should be called every single time a search query is performed. The searchers are taken from a pool of NUM_SEARCHERS searchers. If no searcher is available this may block.

The same searcher must be used for a given query, as it ensures the use of a consistent segment set.

Trait Implementations

impl Debug for Index
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for Index
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more