IndexAdd Method (String, IndexingOptions)
Performs indexing operation. Adds files or folders by an absolute or relative path. Documents from all subfolders will be indexed.

Namespace: GroupDocs.Search
Assembly: GroupDocs.Search (in GroupDocs.Search.dll) Version: 20.8
Syntax
public void Add(
	string[] paths,
	IndexingOptions options
)

Parameters

paths
Type: SystemString
The paths to a files or folders to be indexed.
options
Type: GroupDocs.Search.OptionsIndexingOptions
The indexing options.
Examples
The example demonstrates how to add documents to an index with particular indexing options.
C#
string indexFolder = @"c:\MyIndex\";
string folderPath = @"c:\MyDocuments\";
string filePath = @"c:\Documents\MyFile.txt";

Index index = new Index(indexFolder); // Creating index in the specified folder

IndexingOptions options = new IndexingOptions();
options.Threads = 2; // Setting the number of indexing threads
string[] paths = new string[] { folderPath, filePath };
index.Add(paths, options); // Indexing documents at the specified paths
See Also