AddToRepository
Leave feedback
On this page
Adds an index to the index repository.
public void AddToRepository(Index index)
| Parameter | Type | Description |
|---|---|---|
| index | Index | The index to add. |
| exception | condition |
|---|---|
| ArgumentNullException | The index is null. |
The repository does not dispose of the index: dispose of it when it is no longer needed, see Dispose.
The example demonstrates how to add an index to the index repository.
Index index = new Index();
IndexRepository indexRepository = new IndexRepository();
indexRepository.AddToRepository(index);
- class Index
- class IndexRepository
- namespace GroupDocs.Search
- assembly GroupDocs.Search
Opens and adds an index to the index repository.
public void AddToRepository(string indexFolder)
| Parameter | Type | Description |
|---|---|---|
| indexFolder | String | The index folder. |
| exception | condition |
|---|---|
| IOException | Another Index object uses the folder, in this process or in another one, or an index is saved or updated into the folder at the moment. |
The repository does not dispose of the index: dispose of it when it is no longer needed, see Dispose.
The example demonstrates how to add an index to the index repository.
string indexFolder = @"c:\MyIndex\";
IndexRepository indexRepository = new IndexRepository();
indexRepository.AddToRepository(indexFolder);
- class IndexRepository
- 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.