AlgoliaSynonyms constructor
const
AlgoliaSynonyms({})
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.');