IndexRepository Class
Represents a container for combining multiple indexes and performing common operations on them.
Inheritance Hierarchy
SystemObject
  GroupDocs.SearchIndexRepository

Namespace: GroupDocs.Search
Assembly: GroupDocs.Search (in GroupDocs.Search.dll) Version: 20.4
Syntax
public class IndexRepository : IDisposable

The IndexRepository type exposes the following members.

Constructors
  NameDescription
Public methodIndexRepository
Initializes a new instance of the IndexRepository class.
Properties
  NameDescription
Public propertyEvents
Gets the event hub for subscribing to events.
Public propertyIndexes
Gets the indexes contained in this IndexRepository.
Methods
  NameDescription
Public methodCode exampleAddToRepository(String)
Opens and adds an index to the index repository.
Public methodCode exampleAddToRepository(Index)
Adds an index to the index repository.
Public methodCode exampleCreate
Creates a new index in memory.
Public methodCode exampleCreate(String)
Creates a new index on disk. The index folder will be cleaned before the index creation.
Public methodCode exampleCreate(IndexSettings)
Creates a new index in memory.
Public methodCode exampleCreate(String, IndexSettings)
Creates a new index on disk. The index folder will be cleaned before the index creation.
Public methodDispose
Releases all resources used by the IndexRepository.
Public methodEquals (Inherited from Object.)
Protected methodFinalize
Finalizes an instance of the IndexRepository class.
(Overrides ObjectFinalize.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodCode exampleSearch(String)
Searches in all indexes of the repository.
Public methodCode exampleSearch(SearchQuery)
Searches in all indexes of the repository.
Public methodCode exampleSearch(String, SearchOptions)
Searches in all indexes of the repository.
Public methodCode exampleSearch(SearchQuery, SearchOptions)
Searches in all indexes of the repository.
Public methodToString (Inherited from Object.)
Public methodCode exampleUpdate
Updates all indexes in the repository.
Public methodCode exampleUpdate(UpdateOptions)
Updates all indexes in the repository.
Examples
The example demonstrates a typical usage of the class.
C#
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
See Also