GroupDocs.Search for .NET 18.7 Release Notes

Major Features

There are 4 enhancements in this regular monthly release. The most notable are:

  • Implement using morphological word forms dictionary in search
  • Implement possibility to break updating operation manually
  • Implement possibility to break merging operation manually
  • Implement possibility to break indexing with Cancelation object

All Changes

KeySummaryCategory
SEARCHNET-236Implement using morphological word forms dictionary in searchEnhancement
SEARCHNET-1301Implement possibility to break updating operation manuallyEnhancement
SEARCHNET-1302Implement possibility to break merging operation manuallyEnhancement
SEARCHNET-1616Implement possibility to break indexing with Cancelation objectEnhancement

Public API and Backward Incompatible Changes

Description

This enhancement allows a user to search for different word forms.
For example, a user can search for singular and plural forms of a noun at the same time.
Or the user can search for all existing forms of a verb at the same time: root, third-person singular, present participle, simple past, and past participle.
In addition, the user can implement custom word forms provider to use in a language other than English.
To do so the user needs to write the class that implements IWordFormsProvider interface and assign property DictionaryCollection.WordFormsProvider with an instance of that class.
Note that the default value of DictionaryCollection.WordFormsProvider property is an instance of class EnglishWordFormsProvider.
The EnglishWordFormsProvider class provides word forms search functionality for the English language.

Public API changes

Property bool UseWordFormsSearch has been added to GroupDocs.Search.SearchParameters class.

Interface IWordFormsProvider has been added to GroupDocs.Search namespace.
Method GetWordForms(String) nas been added to GroupDocs.Search.IWordFormsProvider interface.

Class EnglishWordFormsProvider has been added to GroupDocs.Search namespace.
Constructor EnglishWordFormsProvider() nas been added to GroupDocs.Search.EnglishWordFormsProvider class.
Method GetWordForms(String) nas been added to GroupDocs.Search.EnglishWordFormsProvider class.

Property IWordFormsProvider WordFormsProvider has been added to GroupDocs.Search.DictionaryCollection class.

Usecases

The following code snippet shows how to perform the search for different word forms.

C#

string folderForIndex = "c:\\MyIndex\\";
string folderWithDocuments = "c:\\MyDocuments\\";

Index index = new Index(folderForIndex); // Creating index in c:\MyIndex\ folder
index.AddToIndex(folderWithDocuments); // Indexing folder with documents

SearchParameters parameters = new SearchParameters();
parameters.UseWordFormsSearch = true; // Enabling word forms search

SearchResults results1 = index.Search("simplest", parameters); // Searching for words "simplest", "simple", and "simpler"
SearchResults results2 = index.Search("swimming", parameters); // Searching for words "swim", "swims", "swimming", "swam", "swum"

Implement possibility to break updating operation manually

Description

This enhancement is implemented for the possibility of cancelling the updating operation by request and for time limitation of indexing. The break is not instantaneous and in cases of indexing large documents during updating, the breaking can take about a second.

Public API changes

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

Usecases

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

C#

string indexFolder = @"c:\MyIndex";

// Load index
Index index = new Index(indexFolder);

// Updating index
index.UpdateAsync();

// Breaking updating
index.Break();

This example shows how to break updating with Cancellation object.

C#

string indexFolder = @"c:\MyIndex";

// Creating cancellation object
Cancellation cancellation = new Cancellation();

// Load index
Index index = new Index(indexFolder);

// Updating
index.UpdateAsync(cancellation);


// Cancelling
cancellation.Cancel();

Implement possibility to break merging operation manually

Description

This enhancement is implemented for the possibility of cancelling the merging operation by request. The break is not instantaneous and in cases of merging several indexes, the breaking can take about a second.

Public API changes

Method void Merge(Cancellation) has been added to GroupDocs.Search.Index class.
Method void Merge(bool, Cancellation) has been added to GroupDocs.Search.Index class.
Method void Merge(Index, bool, Cancellation) has been added to GroupDocs.Search.Index class.
Method void Merge(IndexRepository, bool, Cancellation) has been added to GroupDocs.Search.Index class.
Method void MergeAsync(bool, Cancellation) has been added to GroupDocs.Search.Index class.
Method void MergeAsync(Index, bool, Cancellation) has been added to GroupDocs.Search.Index class.
Method void MergeAsync(IndexRepository, bool, Cancellation) has been added to GroupDocs.Search.Index class.

Usecases

The following code snippet shows how to break the merging process.

C#

string indexFolder = @"c:\MyIndex";
string documentsFolder = @"c:\MyDocuments";

// Creating cancellation object 
Cancellation cancellation = new Cancellation();
// cancelation after 5 seconds
cancellation.CancelAfter(5000);

// Load index
Index index = new Index(indexFolder);
index.Merge(cancellation);

Implement possibility to break indexing with Cancelation object

Description

This enhancement is implemented for the possibility of cancelling the indexing operation by request and for time limitation of indexing. The break is not instantaneous and in cases of indexing large documents, the breaking can take about a second.

Public API changes

Method void AddToIndex(string, Cancellation) has been added to GroupDocs.Search.Index class.
Method void AddToIndex(string, int, bool, Cancellation) has been added to GroupDocs.Search.Index class.
Method void AddToIndex(string[], Cancellation) has been added to GroupDocs.Search.Index class.
Method void AddToIndex(string[], int, Cancellation) has been added to GroupDocs.Search.Index class.
Method void AddToIndex(string[], bool, Cancellation) has been added to GroupDocs.Search.Index class.
Method void AddToIndex(string[], int, bool, Cancellation) has been added to GroupDocs.Search.Index class.
Method void AddToIndexAsync(string, Cancellation) has been added to GroupDocs.Search.Index class.
Method void AddToIndexAsync(string, int, Cancellation) has been added to GroupDocs.Search.Index class.
Method void AddToIndexAsync(string, bool, Cancellation) has been added to GroupDocs.Search.Index class.
Method void AddToIndexAsync(string, int, bool, Cancellation) has been added to GroupDocs.Search.Index class.
Method void AddToIndexAsync(string[], Cancellation) has been added to GroupDocs.Search.Index class.
Method void AddToIndexAsync(string[], int, Cancellation) has been added to GroupDocs.Search.Index class.
Method void AddToIndexAsync(string[], bool, Cancellation) has been added to GroupDocs.Search.Index class.
Method void AddToIndexAsync(string[], int, bool, Cancellation) has been added to GroupDocs.Search.Index class.

Usecases

The following code snippet shows how to cancel the async indexing operation by request.

C#

string indexFolder = @"c:\MyIndex";
string documentsFolder = @"c:\MyDocuments";

// Creating cancellation object
Cancellation cancellation = new Cancellation();

// Creating index
Index index = new Index(indexFolder);

// Indexing
index.AddToIndexAsync(documentsFolder, cancellation);

// Cancelling after 1 second of indexing
Thread.Sleep(1000);
cancellation.Cancel();

This example shows how to search with time limitation.

C#

string indexFolder = @"c:\MyIndex";
string documentsFolder = @"c:\MyDocuments";

// Creating cancellation object
Cancellation cancellation = new Cancellation();
// Cancelling after 1 second of searching
cancellation.CancelAfter(1000);

// Creating index
Index index = new Index(indexFolder);

// Indexing
index.AddToIndex(documentsFolder, cancellation);