add_range method

add_range

Adds the specified collection of words to this StopWordDictionary.

Stop words are excluded from indexing when the use_stop_words index setting is enabled.

def add_range(self, words):
    ...
Parameter Type Description
words Iterable[str] The collection of words to add to the dictionary.
Raises Description
RuntimeError The call changes the dictionary of an index that contains documents, is not in the IndexStatus.ready status, or is disposed.

Example

from groupdocs.search import Index

index = Index("./index")
stop_words = index.dictionaries.stop_word_dictionary
stop_words.add_range(["a", "an", "the", "but", "by"])

add_range

Adds the specified collection of words to the StopWordDictionary instance.

def add_range(self, words):
    ...
Parameter Type Description
words list[str] The collection of words to add to the dictionary.
Raises Description
RuntimeError The call changes the dictionary of an index that contains documents, is not in the IndexStatus.ready status, or is disposed.

Example

# Add stop words to the dictionary of an existing index
index.dictionaries.stop_word_dictionary.add_range(["physics", "chemistry"])

Aliases

These names call add_range too, limited to the overloads listed.

Alias Accepts
add_range_files add_range_files(words)
add_range_files(words)
add_range_strings add_range_strings(words)
add_range_strings(words)
add_range_ienumerable add_range_ienumerable(words)

See Also