Modifying Item Language

When indexing content, Coveo can detect several languages on readable pages and leverage them to fill the language metadata (see Supported Languages - Coveo Cloud). However, you may encounter situations where Coveo has detected no or too many languages.

You may want to address this problem by using an indexing pipeline extension (IPE) script to manipulate the language metadata. This post-conversion extension script sample sets the language metadata to English if many or no languages have been detected.

Post-conversion Extension Script Sample

# force English when many or no languages have been detected
language = document.get_meta_data_value('language')
if (not language) or (language and ';' in language[0]):
  document.add_meta_data({'language': 'English'})
Recommended Articles