AlgoliaSynonyms constructor

const AlgoliaSynonyms({
  1. required String objectID,
  2. required SynonymsType type,
  3. List<String>? synonyms,
  4. List<String>? corrections,
  5. List<String>? replacements,
  6. String? input,
  7. String? word,
  8. String? placeholder,
  9. bool forwardToReplicas = false,
})

Implementation

const AlgoliaSynonyms({
  required this.objectID,
  required this.type,
  this.synonyms,
  this.corrections,
  this.replacements,
  this.input,
  this.word,
  this.placeholder,
  this.forwardToReplicas = false,
})  : assert(
          (type == SynonymsType.synonym && synonyms != null) ||
              type != SynonymsType.synonym,
          '`synonyms` (array of strings): Words or phrases to be considered equivalent.'),
      assert(
          (type == SynonymsType.onewaysynonym &&
                  synonyms != null &&
                  input != null) ||
              type != SynonymsType.onewaysynonym,
          ' - `input` (string): Word or phrase to appear in query strings. \n - `synonyms` (array of strings): Words or phrases to be matched in records.'),
      assert(
          (type == SynonymsType.altcorrection1 &&
                  corrections != null &&
                  word != null) ||
              type != SynonymsType.altcorrection1,
          '- `word` (string): Word or phrase to appear in query strings. \n - `corrections` (array of strings): Words to be matched in records. Phrases (multiple-word synonyms) are not supported.'),
      assert(
          (type == SynonymsType.altcorrection2 &&
                  corrections != null &&
                  word != null) ||
              type != SynonymsType.altcorrection2,
          '- `word` (string): Word or phrase to appear in query strings. \n - `corrections` (array of strings): Words to be matched in records. Phrases (multiple-word synonyms) are not supported.'),
      assert(
          (type == SynonymsType.placeholder &&
                  replacements != null &&
                  placeholder != null) ||
              type != SynonymsType.placeholder,
          '- `placeholder` (string): Token to be put inside records. \n - `replacements` (array of strings): List of query words that will match the token.');