EventHub Class
Provides index events for subscribing.
Inheritance Hierarchy
SystemObject
  GroupDocs.Search.EventsEventHub

Namespace: GroupDocs.Search.Events
Assembly: GroupDocs.Search (in GroupDocs.Search.dll) Version: 20.11
Syntax
public class EventHub

The EventHub type exposes the following members.

Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Events
  NameDescription
Public eventCode exampleErrorOccurred
Occurs when an error happens during an index operation.
Public eventCode exampleFileIndexing
Occurs when a document is going to be indexed.
Public eventCode exampleOperationFinished
Occurs when an index operation is finished.
Public eventCode exampleOperationProgressChanged
Occurs when the progress of indexing or update operation is changed.
Public eventCode examplePasswordRequired
Occurs when a document requires password for opening.
Public eventCode exampleSearchPhaseCompleted
Occurs when the search phase is completed.
Public eventCode exampleStatusChanged
Occurs when the index status changes.
Remarks
Examples
The example demonstrates a typical usage of the interface.
C#
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