Multi-Threaded & Compact Indexing with Less Storage

GroupDocs.Search for .NET

GroupDocs team is pleased to announce three enhancements in GroupDocs.Search for .NET 18.2. Using the latest version, you can now perform indexing in multiple threads using multi-threaded indexing. Furthermore, you can now implement compact indexing that consumes up to 5 times less disk space. We would recommend you to download the latest version for better user experience.

Multi-Threaded Indexing in C#

In this enhancement, you can perform indexing in multiple threads. Multi-threaded indexing is faster but uses more memory and may cause memory overflow error. If you have only 8 GB of RAM installed, it is recommended to use not more than 2 threads for indexing. If you have 16 GB of RAM installed, you can use 4 threads for indexing. Following code sample shows how to use multi-threaded indexing.

string indexFolder = @"c:\MyIndex";
string documentsFolder = @"c:\MyDocuments";
 
// Creating index
Index index = new Index(indexFolder);
 
// Indexing in 2 threads
index.AddToIndex(documentsFolder, 2);
 
// Searching
SearchResults result = index.Search("Einstein");

You can also run multi-threaded indexing using the asynchronous method as shown in the following code sample.

string indexFolder = @"c:\MyIndex";
string documentsFolder = @"c:\MyDocuments";
 
// Creating index
Index index = new Index(indexFolder);
 
// Indexing in 2 threads
index.AddToIndexAsync(documentsFolder, 2);
 
// User can perform a search after the completion of the indexing operation

Compact Indexing

This enhancement allows you to create an index that consumes up to 5 times less disk space. This is possible for the reason of containing only number of word occurrences without positions. For the same reason, index of this type does not support phrase search and date range search.

string indexFolder = @"c:\MyIndex";
string documentsFolder = @"c:\MyDocuments";
 
// Creating indexing settings object
IndexingSettings indexingSettings = new IndexingSettings();
// Setting compact index type
indexingSettings.IndexType = IndexType.CompactIndex;
 
// Creating index
Index index = new Index(indexFolder, indexingSettings);
 
// Indexing
index.AddToIndex(documentsFolder);
 
// Searching
SearchResults result = index.Search("Einstein");

Improved Index Structure to Increase Indexing Speed

This enhancement is implemented to increase indexing performance. As a result, the performance of single-threaded indexing has been improved by around 8%.

Available Channels and Resources

Here are a few channels and resources for you to download, try, learn and get technical support on GroupDocs.Search:

Feedback

If you have any suggestions, questions, or queries related to the .NET Search API, we will be happy to hear from you. Just create a forum thread to share your thoughts.