Search network deployment

The GroupDocs.Search search network consists of one master node and several slave nodes. Each node is a hardware server with the .NET platform deployed on it. Inside the .NET platform, an application is deployed that creates an instance of the SearchNetworkNode class.

An instance of the SearchNetworkNode class provides the services described in the configuration:

  • Indexing service;
  • Search services;
  • Extraction services;
  • Shard services.

Indexing and search services also provide an interface to access all search network features.

To deploy the GroupDocs.Search search network, you must perform the following steps:

The following code example demonstrates starting a slave node on the server.

C#

SearchNetworkNode node1 = SearchNetworkNode.CreateSlaveNode(
    1,
    basePath + "Node1",
    new TcpSettings(basePort + 1, sendTimeout, receiveTimeout, connectTimeout, retryTimeout));
node1.Start();

The following code example demonstrates starting a master node on the server.

C#

SearchNetworkNode node0 = SearchNetworkNode.CreateMasterNode(
    0,
    basePath + "Node0",
    new TcpSettings(basePort, sendTimeout, receiveTimeout, connectTimeout, retryTimeout),
    new ConsoleLogger(),
    configuration);

node0.Events.ConfigurationCompleted += (s, e) =>
{
    Console.WriteLine("Configuration complete");
};

Console.WriteLine();
Console.WriteLine("Configuring the search network");
node0.ConfigureAllNodes();

Console.WriteLine("Launching the search network");
node0.Start();

The following code example demonstrates the implementation of a simple console logger.

C#

class ConsoleLogger : ILogger
{
    public void Error(string message)
    {
        Console.WriteLine("Error: " + message);
    }

    public void Trace(string message)
    {
        Console.WriteLine("Trace: " + message);
    }
}

More resources

GitHub examples

You may easily run the code from documentation articles and see the features in action in our GitHub examples:

Free online document search App

Along with full featured .NET library we provide simple, but powerful free Apps.

You are welcome to search over your PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX and more with our free online Free Online Document Search App.