GroupDocs.Search for .NET 23.12 Release Notes

Major Features

There are the following features, enhancements, and fixes in this release:

  • Implement loading the search network configuration and saving it to a file

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
SEARCHNET-3013Implement loading the search network configuration and saving it to a fileEnhancement

Public API and Backward Incompatible Changes

Implement a search on the search network using a search query in text form

This enhancement makes it possible to save the search network configuration to a file or stream in the XML format, as well as load the configuration from the file or stream in the XML format.

Public API changes

Method GroupDocs.Search.Scaling.Configuring.Configuration Load(System.String) has been added to GroupDocs.Search.Scaling.Configuring.Configuration class.
Method GroupDocs.Search.Scaling.Configuring.Configuration Load(System.IO.Stream) has been added to GroupDocs.Search.Scaling.Configuring.Configuration class.
Method Void Save(System.String) has been added to GroupDocs.Search.Scaling.Configuring.Configuration class.
Method Void Save(System.IO.Stream) has been added to GroupDocs.Search.Scaling.Configuring.Configuration class.

Use cases

The following example demonstrates how to save the search network configuration to a file and then load from the file.

C#

// Create a configuration
string address = "127.0.0.1";
Configuration configuration = new Configurator()
    .SetIndexSettings()
        .SetUseStopWords(false)
        .SetUseCharacterReplacements(false)
        .SetTextStorageSettings(true, Compression.High)
        .SetIndexType(IndexType.NormalIndex)
        .SetSearchThreads(NumberOfThreads.Default)
        .CompleteIndexSettings()
    .AddNode(0)
        .SetTcpEndpoint(address, basePort)
        .AddLogSink()
        .AddIndexer(basePath + "Indexer0")
        .AddSearcher(basePath + "Searcher0")
        .CompleteNode()
    .AddNode(1)
        .SetTcpEndpoint(address, basePort + 1)
        .AddShard(basePath + "Shard1")
        .AddExtractor(basePath + "Extractor1")
        .CompleteNode()
    .AddNode(2)
        .SetTcpEndpoint(address, basePort + 2)
        .AddShard(basePath + "Shard2")
        .AddExtractor(basePath + "Extractor2")
        .CompleteNode()
    .AddNode(3)
        .SetTcpEndpoint(address, basePort + 3)
        .AddShard(basePath + "Shard3")
        .AddExtractor(basePath + "Extractor3")
        .CompleteNode()
    .CompleteConfiguration();

// Save the configuration to a file
string filePath = "C:\\Configuration.xml";
configuration.Save(filePath);

// Load the configuration from the file
Configuration loadedConfiguration = Configuration.Load(filePath);