Configuring a search network involves creating a configuration using the Configurator class and the fluent interface.
The Configurator class has methods for configuring general index settings, as well as for configuring each individual network node.
The SetIndexSettings method creates an instance of the IndexSettingsConfigurator class, which allows you to set the following settings for each index of the distributed search network:
Flag for using stop words when indexing (SetUseStopWords method).
To complete the configuration of index settings, you must call the CompleteIndexSettings method.
To configure individual search network nodes, use the AddNode method, which returns an instance of the NodeConfigurator class.
The NodeConfigurator class allows you to set the following node parameters:
Set the required IP address and port number of the search network node (SetTcpEndpoint method).
Declare the node as a receiver of log messages for all other network nodes (AddLogSink method).
Add an indexing service, which is the input for all operations that change the contents of shards in network nodes (AddIndexer method). This service must be presented on the network exactly once.
Add a search service, which is the input for all search queries to the network (AddSearcher method).
Add an extraction service used to extract data from documents added to the search network (AddExtractor method). Increasing the number of extraction services (one per network node) increases the performance of search network indexing.
Add a shard service used to store extracted data in a form suitable for searching on the network (AddShard method). Increasing the number of shards (one for each network node) increases the performance of searching the network.
To complete the configuration of a network node, you must call the CompleteNode method.
Once the search network configuration is complete, you must call the CompleteConfiguration method, which will return an instance of the Configuration class.
An instance of the Configuration class can be saved to a file or stream in the XML format using the Save method, and subsequently can be loaded from the file or stream using the Load method.
The following code example shows how to create a search network configuration that describes four nodes.