ErrorOccurred

EventHub.ErrorOccurred event

Occurs when an error occurs during an index operation.

public event EventHandler<IndexErrorEventArgs> ErrorOccurred;

Examples

The example demonstrates how to use the event.

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

// Creating an index
Index index = new Index(indexFolder);

// Subscribing to the event
index.Events.ErrorOccurred += (sender, args) =>
{
    Console.WriteLine(args.Message);
};

// Indexing documents from the specified folder
index.Add(documentsFolder);

// Searching in the index
SearchResult result = index.Search(query);

See Also