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.SearchAssembly: GroupDocs.Search (in GroupDocs.Search.dll) Version: 21.8.1
Syntaxpublic void Add(
string[] paths,
IndexingOptions options
)
Public Sub Add (
paths As String(),
options As IndexingOptions
)
public:
void Add(
array<String^>^ paths,
IndexingOptions^ options
)
member Add :
paths : string[] *
options : IndexingOptions -> unit
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.
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;
string[] paths = new string[] { folderPath, filePath };
index.Add(paths, options);
See Also