The new release of MadCap Flare 2018 introduced Elasticsearch as a new search engine option. Elasticsearch gives you many configurable options that provide dynamic and predictive search results.

One of these configurable options allows you to enable fuzzy matching. If you enable fuzzy matches in output, search results match similar words based on your search criteria.

To enable this feature in the Target Editor, click the Search tab, and check Include fuzzy matches. Keep in mind that this option is only available for Elasticsearch output.

fuzzy matching 01

General Rules of Fuzzy Matching in Elasticsearch

When fuzzy matching is enabled, the following rules are applied:

  • Allows zero edits for strings of one or two characters (e.g., to, by, on)
  • Allows one edit for strings between three to five characters (e.g., rnu could be construed as run, flies could be construed as file, hleps could be construed as helps)
  • Allows two edits for strings greater than five characters (e.g., sievrly could be construed as severely)

Potential Disadvantages of Fuzzy Matching

When fuzzy matching is enabled in your target, you run the risk of getting inadvertent search results for one of your topics. For example, if you type the search string “image,” you may get search results for “imagine.” So it is important to test your Elasticsearch output prior to publishing to ensure you get appropriate search results.

Advantages of Fuzzy Matching

When you enable fuzzy matching in a target, there is an extended capability to match your search criteria if the search engine does not immediately locate it. This feature of Elasticsearch matches your search string by using several methods.

Substitution

This method replaces a letter to provide better matching results. If the search string does not locate any potential matches, the fuzzy matching logic substitutes a letter(s) to suggest a better match.

fuzzy matching 02

Insertion

This inserts a letter within the search string to provide more search results. The insertion of the additional letters displays additional search suggestions.

fuzzy matching 03

Deletion

This takes any additional letters that may have been typed in the search string and drops them when providing relevant search results. The deletion method takes into account any potential misspellings in the search string.

fuzzy matching 04

Transposition

This switches the order of letters in the search string to provide more relevant search results. Fuzzy matching uses the transposition method to take a search string that typically might not return any results by transposing letters in the query to provide more relevant results. One benefit of transposition is that it could convert any inadvertently misspelled search strings and transpose some of the letters in that string to provide a more accurate search result.

fuzzy matching 05

Summary

These are but a few examples of how enabling fuzzy matching in your Elasticsearch output provides more relevant searches. This can be helpful if users are having trouble searching for topics of interest to them. While it is possible that you may get additional results that are not as relevant as their original search criteria, fuzzy matching is beneficial overall in creating search results that are more robust and relevant.

For more information, visit the online Help page on Elasticsearch in MadCap Flare.