IndexAdd Method (String)
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.6
Syntax
public void Add(
	string[] paths
)

Parameters

paths
Type: SystemString
The paths to a files or folders to be indexed.
Examples
The example demonstrates how to add documents to an index.
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

string[] paths = new string[] { folderPath, filePath };
index.Add(paths); // Indexing documents at the specified paths
See Also