API Reference / API Parameters / decompoundQuery
Type: boolean
Engine default: true
Parameter syntax
'decompoundQuery' => true

Can be used in these methods:

About this parameter

Splits compound words into their composing atoms in the query.

Compound words segmentation splits compound words into atoms to ensure a higher chance of finding relevant matches.

When true, it ensures that compound words are split in search queries. When false, all compound words remain whole. This applies for queries where queryLanguages is set to de, nl, fi, da, sv or no.

Usage notes

  • This parameter works alongside the queryLanguages setting and is complementary with decompoundedAttributes.
  • Most of the time, you should use this feature as it leads to better matching and relevance in the compatible languages.
  • List of supported languages : German, Dutch, Finnish, Danish, Swedish, and Norwegian.

Examples

Enable splitting compound words by default

1
2
3
$index->setSettings(array(
  'decompoundQuery' => true,
));
1
2
3
$res = $index->search('query string', [
  'decompoundQuery' => true
]);

Did you find this page helpful?