setDecompoundedAttributes method

AlgoliaQuery setDecompoundedAttributes(
  1. dynamic value
)

decompoundedAttributes

Specify on which attributes in your index Algolia should apply word segmentation, also known as decompounding.

A compound word refers to a word that is formed by combining smaller words without spacing.

They’re called noun phrases, or nominal groups, and are particularly present in Germanic and Scandinavian languages. An example is the German “Gartenstühle,” which is a contraction of “Garten” and “Stühle.”

The goal of decompounding, regarding the previous example, is to index both “Garten” and “Stühle” separately, instead of together as a single word. This way, if a user searches for “Stühle”, Algolia returns results with “Gartenstühle” and other “Stühle”, for example “Polsterstühle”, “Bürostühle”, etc.

Usage notes:

  • You can specify different attributes for each language.
  • As of today, the setting supports only six languages: Dutch (nl), German (de), Finnish (fi), Danish (da), Swedish (sv) and Norwegian Bokmål (no).
  • Note The attributes listed must have been defined by searchableAttributes.

Source: Learn more

Implementation

AlgoliaQuery setDecompoundedAttributes(dynamic value) {
  assert(value != null, 'value can not be empty');
  assert(!_parameters.containsKey('decompoundedAttributes'));
  return _copyWithParameters(
      <String, dynamic>{'decompoundedAttributes': value});
}