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.
Since version 26.11, an exception thrown by a handler of an event is written to the log of the node, and the other handlers of the event are called. No event of a node occurs after the node is disposed, and the completion event of an operation that the disposal stops does not occur (see Stopping a node).
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.
Since version 26.11, the ErrorOccurred event of the master node also reports the errors of the other nodes: a document or a shard that a node could not process in an operation of the indexer, for example because the node is lost; a document that a cancelled addition or extraction has not processed; and the errors that the index of a shard or of an extractor reports while it carries out an operation of the indexer, a highlighting or the getting of a document text, for example for a document whose text cannot be extracted. The arguments contain the indexes of the node and the service of the error, and the operation completes with the other documents and shards (see Errors and lost nodes).
IndexingProgressChanged event
The IndexingProgressChanged event occurs when the progress of the indexing operation has changed. Since version 26.11, a shard indexes the documents that come one after another together, and the event occurs once for every answer of a shard, which may report several documents: the ProcessedDocuments property of the event arguments grows by their number. The DocumentIndexed event still occurs for every document.
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.