Multilingual Search
On a site translated with Drupal's Content Translation, visitors search in the language they are reading: the Finnish site finds Finnish pages, the German site German ones. There is nothing to set up.
How it works
- Each translation is its own document. The sitemap lists every published translation under its own address, and Data Ingestion sends each translation separately.
- Each one knows its language. The module adds the page's locale (for example
en_gb) and its language (en) to every page, and Data Ingestion writes the same into each document. - Each search stays in the visitor's language. On a multilingual site, the search page keeps the results to the language of the page the visitor is on. A one-language site gets no such filter.
The details
- Regions: a language with a region, such as
en-gb, matches that exact locale; a language without one, such asde, matches every German locale. - Documents: an attached file sent with Data Ingestion keeps the language of its page. A crawled file gets the language detected from its own text, which is why the module recommends Data Ingestion for files.
- Category names and taxonomy levels are written in the language of each translation.
- Real-time sync sends the translation that was saved; deleting an item removes all its translations.
- The crawl reads only the addresses in your sitemap and does not follow language switcher links, so no page is counted twice.