Update

Update()

Re-indexes documents that have been changed or deleted since the last update. Adds new files that have been added to the indexed folders.

public void Update()

Exceptions

exception condition
ObjectDisposedException The index is disposed.

Remarks

A changed file is indexed again with the attributes of its indexed version, also the attributes that ChangeAttributes has given it; the FileIndexing event sees them and can replace them. The links to folders inside the indexed folders are not followed, as when the folders are added.

Examples

The example demonstrates how to update an index.

string indexFolder = @"c:\MyIndex\";
string documentsFolder = @"c:\MyDocuments\";

Index index = new Index(indexFolder); // Creating index in the specified folder
index.Add(documentsFolder); // Indexing documents from the specified folder

// Delete documents from the documents folder or modify them or add new documents to the folder

index.Update(); // Updating the index

See Also


Update(UpdateOptions)

Re-indexes documents that have been changed or deleted since the last update. Adds new files that have been added to the indexed folders.

public void Update(UpdateOptions options)
Parameter Type Description
options UpdateOptions The update options.

Exceptions

exception condition
ArgumentNullException The update options are null.
ObjectDisposedException The index is disposed.

Remarks

A changed file is indexed again with the attributes of its indexed version, also the attributes that ChangeAttributes has given it; the FileIndexing event sees them and can replace them. The links to folders inside the indexed folders are not followed, as when the folders are added.

Examples

The example demonstrates how to update an index with particular update options.

string indexFolder = @"c:\MyIndex\";
string documentsFolder = @"c:\MyDocuments\";

Index index = new Index(indexFolder); // Creating index in the specified folder
index.Add(documentsFolder); // Indexing documents from the specified folder

// Delete documents from the documents folder or modify them or add new documents to the folder

UpdateOptions options = new UpdateOptions();
options.Threads = 2; // Setting the number of indexing threads
index.Update(options); // Updating the index

See Also