How does the language of a site affect my search setup?

The number of languages available on a website typically influences how many crawlers and engines are required to deliver an effective site search experience. To ensure accurate and relevant indexing, it is best practice to assign a dedicated crawler to each language version of the website. This approach helps the crawler correctly interpret language-specific elements such as metadata and stemming.

How to set up one Engine to support multiple languages

While each language version of a website should have its own dedicated crawler to ensure proper indexing and language-specific accuracy, multiple crawlers can be attached to a single search engine.

The engine can then be configured to filter search results based on the correct language version of the domain or site structure. This means that when a user searches, the engine will automatically limit the results to content from the appropriate language, depending on the website version or language setting the user is on.

To configure scoped searching, you will need to add a single line of code in your existing Cludo script: filters.

You add the filter to the script by going to the CludoSettings and adding the following line:

 filters: {"CUSTOM FIELD NAME": ["CUSTOM FIELD VALUE"]}, 

To enable proper filtering by language, you should add a custom field in the crawler settings. For example, you can create a custom field called Language and configure the crawler to assign a specific value, such as “English”, to all URLs that match a certain pattern, for instance, URLs that start with https://yourblog.com/en/.

This setup ensures that each page is tagged with its corresponding language, enabling the engine to filter search results correctly. For example, if you want the search to only return results from pages on the English domain, the JavaScript configuration might look like this:

<script type="text/javascript" src="//customer.cludo.com/scripts/bundles/search-script.min.js"></script>;
<script>
var CludoSearch;
(function () {
var cludoSettings = {
customerId: 0000,
engineId: 0000,
searchUrl: 'https://yourblog.com/search';,
language: 'en',
searchInputs: ['cludo-search-form'],
type: 'inline',
filters: {"Language": ["English"]},
hideSearchFilters: true,
};
CludoSearch= new Cludo(cludoSettings);
CludoSearch.init();
})();
</script>


You can implement different versions of this script on each language version of your site by adjusting both the filters and the language value. For example, on the French version of your site, the configuration could be:

language: 'fr',
filters: {"Language": ["French"]},


This ensures that users only see results relevant to the language and region they are searching from, while also aligning the search interface (e.g., UI labels and messages) with the correct language setting.

If you have questions about your language setup, feel free to contact support.

Tags: