This page contains information about the purpose and use of all search network events. The events are available through the Events property of the SearchNetworkNode class, which returns an instance of the NodeEventHub class.
ConfigurationCompleted event
The ConfigurationCompleted event occurs when the search network configuration process is finished.
IndexingCompleted event
The IndexingCompleted event occurs when indexing of all enqueued documents is finished.
The StatusChanged event occurs when the search network status changes.
DataExtracted event
The DataExtracted event occurs when the data have been extracted from a document. The extracted data are available through the Data property of the event arguments.
DocumentIndexed event
The DocumentIndexed event occurs when a document has been indexed.
DocumentDeleted event
The DocumentDeleted event occurs when a document has been deleted.
ErrorOccurred event
The ErrorOccurred event of a node occurs when an error occurs on this node. The event arguments contain the indexes of the node and the service where the error occurred. The errors of all nodes are also written to the logger of the master node.
IndexingProgressChanged event
The IndexingProgressChanged event occurs when the progress of the indexing operation has changed.
The examples on this page use the master node of a running search network. The following code creates and starts the master node as described on the Search network deployment page; the slave nodes must be started beforehand.
C#
stringbasePath=@"c:\SearchNetwork\";intbasePort=49100;// Loading the search network configuration from a fileConfigurationconfiguration=Configuration.Load(basePath+"Configuration.xml");// Creating, configuring and starting the master node; the timeouts are specified in millisecondsSearchNetworkNodenode=SearchNetworkNode.CreateMasterNode(0,basePath+"Node0",newTcpSettings(basePort,3000,3000,3000,1000),newFileLogger(basePath+"Log.txt",4.0),configuration);node.ConfigureAllNodes();node.Start();
The following code example, which continues the previous one, demonstrates subscribing to the search network events.