IndexRepository class

IndexRepository class

Represents a container for combining multiple indexes and performing common operations on them.

The IndexRepository type exposes the following members:

Constructors

Constructor Description
init Initializes a new instance of the IndexRepository class.

Methods

Method Description
add_to_repository Adds an index to the index repository.
add_to_repository Opens and adds an index to the index repository.
create Creates a new index in memory.
create Creates a new index in memory.
create Creates a new index on disk, cleaning the index folder before creation.
create Creates a new index on disk. The index folder will be cleaned before the index creation.
dispose Releases all resources used by the IndexRepository.
search Searches in all indexes of the repository.
search Searches in all indexes of the repository.
search Searches in all indexes of the repository.
search Searches in all indexes of the repository.
update Updates all indexes in the repository.
update Updates all indexes in the repository.

Properties

Property Description
events The event hub for subscribing to events.
indexes The indexes contained in this IndexRepository.

Example

from groupdocs.search import IndexRepository

index_folder1 = "./MyIndex"
index_folder2 = "./MyIndex"
query = "Einstein"

repo = IndexRepository()
repo.add_to_repository(index_folder1)  # Load an existing index
repo.add_to_repository(index_folder2)  # Load another existing index

result = repo.search(query)  # Search across all indexes in the repository

See Also