IndexRepository
Leave feedback
On this page
Represents a container for combining multiple indexes and performing common operations on them.
public class IndexRepository : IDisposable
| Name | Description |
|---|---|
| IndexRepository() | Initializes a new instance of the IndexRepository class. |
| Name | Description |
|---|---|
| Events { get; } | Gets the event hub for subscribing to events. |
| Indexes { get; } | Gets the indexes contained in this IndexRepository. |
| Name | Description |
|---|---|
| AddToRepository(Index) | Adds an index to the index repository. |
| AddToRepository(string) | Opens and adds an index to the index repository. |
| Create() | Creates a new index in memory. |
| Create(IndexSettings) | Creates a new index in memory. |
| Create(string) | Creates a new index on disk. The index folder will be cleaned before the index creation. |
| Create(string, IndexSettings) | 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(SearchQuery) | Searches in all indexes of the repository. |
| Search(string) | Searches in all indexes of the repository. |
| Search(SearchQuery, SearchOptions) | Searches in all indexes of the repository. |
| Search(string, SearchOptions) | Searches in all indexes of the repository. |
| Update() | Updates all indexes in the repository. |
| Update(UpdateOptions) | Updates all indexes in the repository. |
Learn more
The example demonstrates a typical usage of the class.
string indexFolder1 = @"c:\MyIndex\";
string indexFolder2 = @"c:\MyIndex\";
string query = "Einstein";
IndexRepository repository = new IndexRepository();
repository.AddToRepository(indexFolder1); // Loading an existing index
repository.AddToRepository(indexFolder2); // Loading another existing index
SearchResult result = repository.Search(query); // Searching in indexes of the repository
- namespace GroupDocs.Search
- assembly GroupDocs.Search
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.