Performs an indexing operation. Adds a file or folder by an absolute or relative path. Documents from all subfolders will be indexed.
publicvoidAdd(stringpath)
Parameter
Type
Description
path
String
The path to a file or folder to be indexed.
Exceptions
exception
condition
ObjectDisposedException
The index is disposed.
Remarks
The links to folders inside an added folder, for example the symbolic links and the junctions, are not followed: add the folder that a link names to index its documents. An added path that is a link itself is followed.
Examples
The example demonstrates how to add documents to an index.
stringindexFolder=@"c:\MyIndex\";stringfolderPath=@"c:\MyDocuments\";stringfilePath=@"c:\Documents\MyFile.txt";Indexindex=newIndex(indexFolder);// Creating index in the specified folderindex.Add(folderPath);// Indexing documents in the specified folderindex.Add(filePath);// Indexing the specified document
Performs an indexing operation. Adds a file or folder by an absolute or relative path. Documents from all subfolders will be indexed.
publicvoidAdd(stringpath,IndexingOptionsoptions)
Parameter
Type
Description
path
String
The path to a file or folder to be indexed.
options
IndexingOptions
The indexing options.
Exceptions
exception
condition
ArgumentNullException
The indexing options are null.
ObjectDisposedException
The index is disposed.
Remarks
The links to folders inside an added folder, for example the symbolic links and the junctions, are not followed: add the folder that a link names to index its documents. An added path that is a link itself is followed.
Examples
The example demonstrates how to add documents to an index with particular indexing options.
stringindexFolder=@"c:\MyIndex\";stringfolderPath=@"c:\MyDocuments\";stringfilePath=@"c:\Documents\MyFile.txt";Indexindex=newIndex(indexFolder);// Creating index in the specified folderIndexingOptionsoptions=newIndexingOptions();options.Threads=2;// Setting the number of indexing threadsindex.Add(folderPath,options);// Indexing documents in the specified folderindex.Add(filePath,options);// Indexing the specified document
Performs an indexing operation. Adds files or folders by an absolute or relative path. Documents from all subfolders will be indexed.
publicvoidAdd(string[]paths)
Parameter
Type
Description
paths
String[]
The paths to files or folders to be indexed.
Exceptions
exception
condition
ObjectDisposedException
The index is disposed.
Remarks
The links to folders inside an added folder, for example the symbolic links and the junctions, are not followed: add the folder that a link names to index its documents. An added path that is a link itself is followed.
Examples
The example demonstrates how to add documents to an index.
stringindexFolder=@"c:\MyIndex\";stringfolderPath=@"c:\MyDocuments\";stringfilePath=@"c:\Documents\MyFile.txt";Indexindex=newIndex(indexFolder);// Creating index in the specified folderstring[]paths=newstring[]{folderPath,filePath};index.Add(paths);// Indexing documents at the specified paths
The links to folders inside an added folder, for example the symbolic links and the junctions, are not followed: add the folder that a link names to index its documents. An added path that is a link itself is followed.
Examples
The example demonstrates how to add documents to an index with particular indexing options.
stringindexFolder=@"c:\MyIndex\";stringfolderPath=@"c:\MyDocuments\";stringfilePath=@"c:\Documents\MyFile.txt";Indexindex=newIndex(indexFolder);// Creating index in the specified folderIndexingOptionsoptions=newIndexingOptions();options.Threads=2;// Setting the number of indexing threadsstring[]paths=newstring[]{folderPath,filePath};index.Add(paths,options);// Indexing documents at the specified paths
The documents from file system, stream or structure.
options
IndexingOptions
The indexing options.
Exceptions
exception
condition
ArgumentNullException
The indexing options are null.
ArgumentException
A document is null.
ObjectDisposedException
The index is disposed.
Remarks
A document of a file is indexed with its attributes and additional fields, and a lazy document of a file is loaded when the file is indexed and closed after it; the loader gives the document of the same file. The file is found by the key of the document, as a file that is added by its path: a file that does not exist, does not pass the document filter or is indexed already is not loaded.
An update indexes a changed file again by its path, with the attributes of its indexed version but without the additional fields of its document; the FileIndexing event sees the attributes and can replace them, and can give the additional fields.