Multilingual Search โ€” Multi-Language Support

Search across all your site languages

Multi-Language

Multilingual Search

Full multilingual support out of the box. Each language/locale gets its own search results, filtered automatically by the current page language. Works with Drupal's Content Translation module โ€” no configuration needed.

How Multilingual Indexing Works

Each Translation
= Separate Solr Document
โ†’
Locale Tagged
meta_og_locale: en_gb
โ†’
Auto-Filtered
fq=meta_og_locale:en_gb

When a visitor views your site in English (UK), search only returns English UK results. Switch to Finnish, and search shows Finnish results. Automatic โ€” no configuration needed.

Under the Hood

Sitemap Generation

The module generates /opensolr-sitemap.xml with URLs for every translation of every content type. Each translation gets its own URL with the language prefix (e.g., /en-gb/node/44, /fi/node/44).

Meta Tag Injection

Every page gets <meta property="og:locale" content="en_gb"> and <meta name="language" content="en"> injected automatically. The crawler reads these to set meta_og_locale and meta_detected_language in Solr.

Search Filtering

The search query automatically adds fq=+meta_og_locale:en_gb based on the current Drupal page language. Only results matching the visitor's locale are returned. Monolingual sites skip this filter entirely.

Example: 7-Language Site

A Drupal site with 7 languages and 38 content items produces:

๐Ÿ‡ฌ๐Ÿ‡ง en_gb โ€” 114 docs ๐Ÿ‡บ๐Ÿ‡ธ en_en โ€” 116 docs ๐Ÿ‡ฉ๐Ÿ‡ช de_de โ€” 7 docs ๐Ÿ‡ซ๐Ÿ‡ฎ fi_fi โ€” 6 docs ๐Ÿ‡ท๐Ÿ‡ด ro_ro โ€” 6 docs ๐Ÿ‡ฆ๐Ÿ‡น de_at โ€” 4 docs ๐Ÿ‡ฒ๐Ÿ‡ฉ ro_md โ€” 4 docs

Total: 267 documents from 38 content items ร— 7 languages. Each document has the correct locale, language, and content in the right language.

Recommended Crawler Mode

Use Mode 5 (Shallow Host) โ€” this is the default and recommended mode for multilingual Drupal sites. The crawler follows your sitemap (which includes all translations) and only indexes URLs from the sitemap. It does not follow HTML links on pages, which prevents duplicate locale variants from being discovered via language switcher links.

Data Ingestion + Multilingual

The Data Ingestion API handles multilingual automatically:

  • Ingest All Now builds documents for every translation of every published node
  • Real-time sync pushes the saved translation only (not all translations)
  • Each translation gets its own uri (language-prefixed URL) and meta_og_locale
  • Delete removes all translation documents from the index

Zero Configuration

If your Drupal site has the Content Translation module enabled with URL path prefixes (the standard setup), multilingual search works automatically. No settings to configure, no fields to map, no filters to set up.