GroupDocs.Search for .NET 24.9 Release Notes

Major Features

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

  • Make the search network configuration more unambiguous and understandable
  • Implement a method to get an indexed document by document key
  • Add modification time to document information

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
SEARCHNET-3247Make the search network configuration more unambiguous and understandableBreaking changes
SEARCHNET-3253Implement a method to get an indexed document by document keyEnhancement
SEARCHNET-3254Add modification time to document informationEnhancement

Public API and Backward Incompatible Changes

Make the search network configuration more unambiguous and understandable

These changes make configuring the search network more straightforward, unambiguous, understandable for developers.

Public API changes

Method GroupDocs.Search.Scaling.Configuring.NodeConfigurator AddNode(Int32) has been removed from GroupDocs.Search.Scaling.Configuring.Configurator class.
Method GroupDocs.Search.Scaling.Configuring.NodeConfigurator AddExtractor(System.String) has been removed from GroupDocs.Search.Scaling.Configuring.NodeConfigurator class.
Method GroupDocs.Search.Scaling.Configuring.NodeConfigurator AddIndexer(System.String) has been removed from GroupDocs.Search.Scaling.Configuring.NodeConfigurator class.
Method GroupDocs.Search.Scaling.Configuring.NodeConfigurator AddLogSink() has been removed from GroupDocs.Search.Scaling.Configuring.NodeConfigurator class.
Method GroupDocs.Search.Scaling.Configuring.NodeConfigurator AddSearcher(System.String) has been removed from GroupDocs.Search.Scaling.Configuring.NodeConfigurator class.
Method GroupDocs.Search.Scaling.Configuring.NodeConfigurator AddShard(System.String) has been removed from GroupDocs.Search.Scaling.Configuring.NodeConfigurator class.
Method GroupDocs.Search.Scaling.Configuring.NodeConfigurator SetTcpEndpoint(System.String, Int32) has been removed from GroupDocs.Search.Scaling.Configuring.NodeConfigurator class.

Class MasterNodeConfigurator has been added to GroupDocs.Search.Scaling.Configuring namespace.
Method GroupDocs.Search.Scaling.Configuring.MasterNodeConfigurator AddIndexer(System.String) has been added to GroupDocs.Search.Scaling.Configuring.MasterNodeConfigurator class.
Method GroupDocs.Search.Scaling.Configuring.MasterNodeConfigurator AddSearcher(System.String) has been added to GroupDocs.Search.Scaling.Configuring.MasterNodeConfigurator class.
Method GroupDocs.Search.Scaling.Configuring.MasterNodeConfigurator AddMasterNode(Int32) has been added to GroupDocs.Search.Scaling.Configuring.Configurator class.

Class SlaveNodeConfigurator has been added to GroupDocs.Search.Scaling.Configuring namespace.
Method GroupDocs.Search.Scaling.Configuring.SlaveNodeConfigurator AddExtractor(System.String) has been added to GroupDocs.Search.Scaling.Configuring.SlaveNodeConfigurator class.
Method GroupDocs.Search.Scaling.Configuring.SlaveNodeConfigurator AddShard(System.String) has been added to GroupDocs.Search.Scaling.Configuring.SlaveNodeConfigurator class.
Method GroupDocs.Search.Scaling.Configuring.SlaveNodeConfigurator SetTcpEndpoint(System.String, Int32) has been added to GroupDocs.Search.Scaling.Configuring.SlaveNodeConfigurator class.
Method GroupDocs.Search.Scaling.Configuring.SlaveNodeConfigurator AddSlaveNode(Int32) has been added to GroupDocs.Search.Scaling.Configuring.Configurator class.

Constructor SearchNetworkNode(Int32, System.String, GroupDocs.Search.Scaling.Configuring.INetworkSettings) has been removed from GroupDocs.Search.Scaling.SearchNetworkNode class.
Constructor SearchNetworkNode(Int32, System.String, GroupDocs.Search.Scaling.Configuring.INetworkSettings, GroupDocs.Search.Common.ILogger) has been removed from GroupDocs.Search.Scaling.SearchNetworkNode class.
Constructor SearchNetworkNode(Int32, System.String, GroupDocs.Search.Scaling.Configuring.INetworkSettings, GroupDocs.Search.Common.ILogger, GroupDocs.Search.Scaling.Configuring.Configuration) has been removed from GroupDocs.Search.Scaling.SearchNetworkNode class.
Method GroupDocs.Search.Scaling.SearchNetworkNode CreateMasterNode(Int32, System.String, GroupDocs.Search.Scaling.Configuring.INetworkSettings, GroupDocs.Search.Common.ILogger, GroupDocs.Search.Scaling.Configuring.Configuration) has been added to GroupDocs.Search.Scaling.SearchNetworkNode class.
Method GroupDocs.Search.Scaling.SearchNetworkNode CreateSlaveNode(Int32, System.String, GroupDocs.Search.Scaling.Configuring.INetworkSettings) has been added to GroupDocs.Search.Scaling.SearchNetworkNode class.
Method GroupDocs.Search.Scaling.SearchNetworkNode CreateSlaveNode(Int32, System.String, GroupDocs.Search.Scaling.Configuring.INetworkSettings, GroupDocs.Search.Common.ILogger) has been added to GroupDocs.Search.Scaling.SearchNetworkNode class.

Constructor TcpSettings(Int32, Int32, Int32) has been removed from GroupDocs.Search.Scaling.Configuring.TcpSettings class.
Constructor TcpSettings(Int32, Int32, Int32, Int32, Int32) has been added to GroupDocs.Search.Scaling.Configuring.TcpSettings class.
Property Int32 ConnectTimeout has been added to GroupDocs.Search.Scaling.Configuring.TcpSettings class.
Property Int32 RetryTimeout has been added to GroupDocs.Search.Scaling.Configuring.TcpSettings class.

Use cases

The following code example demonstrates how to configure and run a search network consisting of a master node and three slave nodes.

C#

string basePath = @"C:\Temp\";
int basePort = 49100;
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()
    .AddMasterNode(0)
        .AddIndexer(basePath + "Indexer0")
        .AddSearcher(basePath + "Searcher0")
        .CompleteNode()
    .AddSlaveNode(1)
        .SetTcpEndpoint(address, basePort + 1)
        .AddShard(basePath + "Shard1")
        .AddExtractor(basePath + "Extractor1")
        .CompleteNode()
    .AddSlaveNode(2)
        .SetTcpEndpoint(address, basePort + 2)
        .AddShard(basePath + "Shard2")
        .AddExtractor(basePath + "Extractor2")
        .CompleteNode()
    .AddSlaveNode(3)
        .SetTcpEndpoint(address, basePort + 3)
        .AddShard(basePath + "Shard3")
        .AddExtractor(basePath + "Extractor3")
        .CompleteNode()
    .CompleteConfiguration();

int sendTimeout = 5000;
int receiveTimeout = 5000;
int connectTimeout = 5000;
int retryTimeout = 3000;
SearchNetworkNode masterNode0 = SearchNetworkNode.CreateMasterNode(
    0,
    basePath + "Node0",
    new TcpSettings(basePort, sendTimeout, receiveTimeout, connectTimeout, retryTimeout),
    new FileLogger(basePath + "Log0.txt", 1.0),
    configuration);
SearchNetworkNode slaveNode1 = SearchNetworkNode.CreateSlaveNode(
    1,
    basePath + "Node1",
    new TcpSettings(basePort + 1, sendTimeout, receiveTimeout, connectTimeout, retryTimeout));
SearchNetworkNode slaveNode2 = SearchNetworkNode.CreateSlaveNode(
    2,
    basePath + "Node2",
    new TcpSettings(basePort + 2, sendTimeout, receiveTimeout, connectTimeout, retryTimeout));
SearchNetworkNode slaveNode3 = SearchNetworkNode.CreateSlaveNode(
    3,
    basePath + "Node3",
    new TcpSettings(basePort + 3, sendTimeout, receiveTimeout, connectTimeout, retryTimeout));

Console.WriteLine("Configuring start");
masterNode0.Events.ConfigurationCompleted += (s, e) =>
{
    Console.WriteLine("Configuring complete");
    Console.WriteLine();
};

masterNode0.ConfigureAllNodes();
masterNode0.Start();

Implement a method to get an indexed document by document key

This enhancement allows you to obtain information about an indexed document from the index by the document key.

Public API changes

Method GroupDocs.Search.Results.DocumentInfo GetIndexedDocument(System.String) has been added to GroupDocs.Search.Index class.

Use cases

The following code example demonstrates how to obtain information about an indexed document from the index by the document key.

C#

string indexFolder = @"c:\MyIndex\";
string documentKey = "Some document key";
string content = "Some content";

// Creating an index in the specified folder
Index index = new Index(indexFolder);

// Creating a document from structure
DocumentField[] fields = new DocumentField[]
{
    new DocumentField("Content", content)
};
Document document = Document.CreateFromStructure(documentKey, DateTime.Now, fields);

// Indexing the document
index.Add(new Document[] { document }, new IndexingOptions());

// Getting the document by document key
DocumentInfo indexedDocument = index.GetIndexedDocument(documentKey);

Add modification time to document information

This enhancement allows you to extract the modification time of an indexed document from the index.

Public API changes

Property System.DateTime ModificationTime has been added to GroupDocs.Search.Results.DocumentInfo class.

Use cases

The following code example demonstrates how to extract the modification time of an indexed document from the index.

C#

string indexFolder = @"c:\MyIndex\";
string documentKey = "Some document key";
string content = "Some content";

// Creating an index in the specified folder
Index index = new Index(indexFolder);

// Creating a document from structure
DocumentField[] fields = new DocumentField[]
{
    new DocumentField("Content", content)
};
Document document = Document.CreateFromStructure(documentKey, DateTime.Now, fields);

// Indexing the document
index.Add(new Document[] { document }, new IndexingOptions());

// Getting the document by document key
DocumentInfo indexedDocument = index.GetIndexedDocument(documentKey);

// Getting the modification time of the document
DateTime modificationTime = indexedDocument.ModificationTime;