The alphabet, tokenization dictionary, stop word dictionary, and character replacement dictionary define how document text is divided into terms. Therefore a shard accepts a new dictionary only while its index contains no documents and performs no operation. A shard that does not accept the dictionary retains its existing one and writes the reason to its log.
fromgroupdocs.search.dictionariesimportCharacterType# `node` is the master node of a configured and started search networkindexer=node.indexershard_index=node.get_shard_indices()[0]# A shard accepts a tokenization dictionary only while its index holds no documentsdictionary=indexer.get_tokenization_dictionary(shard_index)dictionary.set_range(list(range(0x3040,0x30FF+1)),CharacterType.LETTER)# Hiragana and Katakanaindexer.set_dictionary(dictionary,shard_index)
set_dictionary
Sets a dictionary in all shards.
The alphabet, the tokenization dictionary, the stop word dictionary and the character replacement dictionary define how the text of documents is divided into terms. Therefore a shard accepts another content of such a dictionary only while its index contains no documents and performs no operation. A shard that does not accept the dictionary keeps its own one and writes the reason to its log.
defset_dictionary(self,dictionary):...
Parameter
Type
Description
dictionary
DictionaryBase
The dictionary.
Example
# Assume `node` is an initialized network nodeindexer=node.indexer# `dictionary` should be a GroupDocs.Search dictionary instance,# such as a tokenization dictionary created or retrieved earlier.indexer.set_dictionary(dictionary)
Aliases
These names call set_dictionary too, limited to the overloads listed.