Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created October 10, 2019 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/8fe7c13d4e392bf9af43d3255ef20749 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/8fe7c13d4e392bf9af43d3255ef20749 to your computer and use it in GitHub Desktop.
string indexFolder = @"c:\MyIndex";
string documentFolder = @"c:\MyDocuments";
// Creating index
Index index = new Index(indexFolder);
// Setting blended character type for Chinese characters
HashSet<char> hashSet = new HashSet<char>();
for (char character = (char)0x4E00; character <= 0x9FFF; character++) // Common
{
hashSet.Add(character);
}
for (char character = (char)0x3400; character <= 0x4DBF; character++) // Rare
{
hashSet.Add(character);
}
char[] characters = new char[hashSet.Count];
hashSet.CopyTo(characters);
index.Dictionaries.Alphabet.SetRange(characters, CharacterType.SeparateWord); // Setting character type
// Adding documents to index
index.Add(documentFolder);
// Searching for the Unicode character U+4E50
SearchResult result = index.Search("\u4E50");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment