When searching within the Web Widget (Classic), why do results return articles in another language?

Question

When I search articles in the Web Widget (Classic), I see results in a different language. For example, the Web Widget (Classic) is in English but the articles returned are in French.

Why does it happen, and how can I solve it?

Answer

The search in the Web Widget (Classic) first looks for articles in the same locale that it uses. If there are no results, it will then look for articles that are not translated in that locale.

For instance, you are on a page with an English Web Widget (Classic) and you search the word "Finance". You have two French articles returned in the results. Here is an example scenario:

The Web Widget (Classic) looks for the word "Finance" in all English articles of the associated Help Center.

Since there are no results, the Web Widget (Classic) now looks for articles that do not have an English translation. It will check all the translations available in those articles.

Two articles that have a French translation, but not an English translation, match the search query.

The Web Widget (Classic) returns the two articles in French.

To resolve this, translate articles in all the enabled languages of the Help Center. In the example above, the search would not return the French articles if they had an English translation. If this is not possible, you might want to filter the search results to a specific category, section, or label in some scenarios. You can do this by using the: filter setting in the Web Widget (Classic) API.