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.SearchAssembly: GroupDocs.Search (in GroupDocs.Search.dll) Version: 21.2
Syntaxpublic void Add(
string path,
IndexingOptions options
)
Public Sub Add (
path As String,
options As IndexingOptions
)
public:
void Add(
String^ path,
IndexingOptions^ options
)
member Add :
path : string *
options : IndexingOptions -> unit
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.
string indexFolder = @"c:\MyIndex\";
string folderPath = @"c:\MyDocuments\";
string filePath = @"c:\Documents\MyFile.txt";
Index index = new Index(indexFolder);
IndexingOptions options = new IndexingOptions();
options.Threads = 2;
index.Add(folderPath, options);
index.Add(filePath, options);
See Also