Skip to content
csupnig edited this page Nov 28, 2014 · 1 revision

Language Fallback with the Gentics Content Connector and Lucene

When using the Content Connector Search in a multi language environment you will often face the problem that the search will return all language versions of a page in the search results.

Add the following lines to your search configuration to enable a language fallback in the search result.

rp.1.collectorInResult=true
rp.1.collectorClass=com.gentics.cr.lucene.search.collector.LanguageFallbackSortingTopDocsCollector
rp.1.collector.languagefallbackpriority=de,en
rp.1.collector.languagefield=languagecode
rp.1.collector.languagesetfield=languagesetid

The parameter languagefallbackpriority=de,en defines the priority of the returned languages. The lower the index in this priority array, the better the language version suited for the result.

This attribute can also be added as a request parameter when requesting the REST API.