GroupDocs.Search for .NET 18.8 Release Notes

Major Features

There is 1 enhancement in this regular monthly release.

  • Implement breaking functionality for IndexRepository class

All Changes

KeySummaryCategory
SEARCHNET-1622Implement breaking functionality for IndexRepository classEnhancement

Public API and Backward Incompatible Changes

Implement breaking functionality for IndexRepository class

Description

This enhancement is implemented for the possibility of cancelling the operations in all indexes in the index repository. The canceling is not instantaneous and in cases of operations with large documents, the breaking can takes about a second.

Public API changes

Method void Update(Cancellation) has been added to GroupDocs.Search.IndexRepository class.
Method void UpdateAsync(Cancellation) has been added to GroupDocs.Search.IndexRepository class.
Method void Break() has been added to GroupDocs.Search.IndexRepository class.

Usecases

The following code snippet shows how to break the updating operation.

C#

string indexFolder = "c:\\MyIndex\\";
string documentsFolder = "c:\\MyDocuments\\";
 
IndexRepository repository = new IndexRepository();
Index index = repository.Create(indexFolder );
index.AddToIndexAsync(indexFolder);
 
// Breaking all processes in all indexes in repository
repository.Break();

This example shows how to break updating with Cancellation object.

C#

string documentsFolder = "c:\\MyDocuments\\";
IndexRepository repository = new IndexRepository();
Index index = repository.Create();
index.AddToIndex(documentsFolder);
  
Cancellation cnc = new Cancellation();
  
// Updating all indexes in repository
repository.UpdateAsync(cnc);
  
// Canceling all operations in index repository
cnc.Cancel();