IndexAdd Method (String, IndexingOptions)
Performs indexing operation. Adds a file or folder 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.6
Syntax
public void Add(
	string path,
	IndexingOptions options
)

Parameters

path
Type: SystemString
The path to a file or folder 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
index.Add(folderPath, options); // Indexing documents in the specified folder
index.Add(filePath, options); // Indexing the specified document
See Also