Synonyms
Krestor's Synonym API allows customers to define groups of terms that will be treated as equivalent by the Krestor search and autosuggest algorithms. As an example, a grocery customer could create a group of synonyms for fat-free milk: fat-free milk
, 0% milk
, skim milk
. A user searching for fat-free milk
, 0% milk
or skim milk
would see all products containing the phrases fat-free milk
, 0% milk
or skim milk
.
Index-by-index
Synonyms are set on each index key separately, so a customer could have separate synonym rules with their grocery property and their electronics property.
Case Insensitive
Synonyms ignore case, so a synonym rule for fat-free milk
would apply to McCormick's Farmstand Fat-Free Milk
as well as McCormick's farmstand fat-free milk
.
Exact Phrase Match
Synonyms match the exact word ordering, so a rule for 0% milk
would not apply to products McCormick's Farmstand Milk 0%
or McCormick's Farmstand 0% fat milk
. To match these products, you'd need to include milk 0%
or 0% fat milk
synonyms in the group.
This approach is taken because intervening words and term order can influence meaning: as one example, a shirt dress
is not equivalent to a dress shirt
.
Transitive Within Group
All synonyms in a group are transitive. Fat-free
searches return 0% milk
and skim milk
products, skim milk
searches return 0% milk
products and vice-versa.
However, a separate group containing non-fat milk
and skim milk
would not establish equivalence between non-fat milk
and 0% milk
by virtue of the separate group establishing the skim milk
relationship.