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 Java platform deployed on it. Inside the Java 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.

SearchNetworkNode node1 = new SearchNetworkNode(
    1,
    basePath + "Node1",
    new TcpSettings(basePort + 1, sendTimeout, receiveTimeout));
node1.start();

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

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

node0.getEvents().ConfigurationCompleted.add(new EventHandler() {
    @Override
    public void invoke(Object s, EventArgs e) {
        System.out.println("Configuration complete");
    }
});

System.out.println();
System.out.println("Configuring the search network");
node0.configureAllNodes();

System.out.println("Launching the search network");
node0.start();

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

public class ConsoleLogger implements ILogger {
    public ConsoleLogger() {
    }

    @Override
    public void error(String message) {
        System.out.println("Error: " + message);
    }

    @Override
    public void trace(String message) {
        System.out.println(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.