ali.ahmed December 31, 20180 Comments

Work with Blended Characters using GroupDocs.Search for .NET 18.12

Work with Blended Characters using GroupDocs.Search for .NET 18.12

December 31, 2018

GroupDocs.Search for .NETWe are delighted to announce the monthly release of GroupDocs.Search for .NET 18.12. Using the latest version, you can now index and search blended characters and perform a wildcard search. We would recommend you to install and use the latest version of the API.

Features

Following are the new features introduced in the latest version:

Blended Characters Search

GroupDocs.Search for .NET API 18.12 introduces a new class of characters – blended. When indexing, blended characters are interpreted simultaneously as valid letters and as separators. For example, if the hyphen is marked as a blended character then indexing of term ‘silver-gray’ will result in saving of 3 terms in the index: ‘silver’, ‘gray’, and ‘silver-gray’. The following code snippet shows how to work with blended characters:


string indexFolder = @"c:\MyIndex";
string documentFolder = @"c:\MyDocuments";
   
// Creating index
Index index = new Index(indexFolder);
   
// Marking hyphen as blended character
index.Dictionaries.Alphabet.SetRange(new char[] { '-' }, CharacterType.Blended);
   
// Adding documents to index
index.AddToIndex(documentFolder);
   
// Searching for word 'silver-gray'
SearchResults results = index.Search("silver-gray");

For more details on this feature, please visit this documentation article.

Wildcard Search

The latest version allows performing search of words containing wildcards. There are two possible forms of wildcards to use in wildcard search:

  • ? – question mark representing one arbitrary character
  • ?(N~M) – the range of arbitrary characters in an amount from N to M, where N and M must be in the range from 0 to 255

This following code snippet shows how to perform wildcard search:


string indexFolder = @"c:\MyIndex";
string documentFolder = @"c:\MyDocuments";
   
// Creating index
Index index = new Index(indexFolder);
   
// Adding documents to index
index.AddToIndex(documentFolder);
   
// Searching for words 'affect' or 'effect' in a one document with 
// 'principal', 'principle', 'principles', or 'principally'
SearchResults results1 = index.Search("?ffect & princip?(2~4)");
   
// Searching with a single query for phrases 'assure equal opportunities', 
// 'ensure equal opportunities', and 'sure equal opportunities'
SearchResults results2 = index.Search("\"?(0~2)sure equal opportunities\"");

For more details on this feature, please visit this documentation article.

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 GroupDocs.Search for .NET API, we will be happy to hear from you. Just create a forum thread to share your thoughts.

Share on FacebookTweet about this on TwitterShare on LinkedIn
Posted inGroupDocs.Search Product FamilyTags: , ,
 

Related Articles