SimilarityLevel class

SimilarityLevel class

Represents an algorithm of the fuzzy search that specifies the similarity level.

Learn more

The SimilarityLevel type exposes the following members:

Constructors

Constructor Description
init Initializes a new SimilarityLevel instance.

Methods

Method Description
get_max_mistake_count Gets the maximum allowed number of mistakes for the specified term length.
get_similarity_level Gets the similarity level value for the specified term length.

Example

from groupdocs.search import Index
from groupdocs.search.options import SearchOptions, SimilarityLevel

index = Index("./index")
index.add("./documents")
options = SearchOptions()
options.fuzzy_search.enabled = True
options.fuzzy_search.fuzzy_algorithm = SimilarityLevel(0.8)  # 0.0 loose .. 1.0 strict
result = index.search("contarct", options)
print(result.document_count)

Guides

Task guides that use SimilarityLevel:

See Also