You can add two kinds of entries to your thesaurus:
A
one-way
thesaurus entry, which establishes a mapping between a search term and its thesaurus entry that applies in a single direction only.For example, you can define a one-way mapping so that all queries on “tools” (the shopper’s search term) return matches containing “hammers” (a synonym for “tools” specified in the thesaurus) as well as matches on “tools”. Note, however, that this mapping works only one way: searching for the thesaurus entry “hammers” does not return matches containing the word “tools”.
A
multi-way
thesaurus entry, which specifies two-way mappings between two or more words or phrases that are treated as equivalents of each other.For example, a
multi-way
entry might specify that the terms “adapter”, “converter”, and “adapter converter” are equivalents of each other. A search on any one of these terms can return matches on any of the three.
The following table describes the JSON attributes that configure a thesaurus and thesaurus entries.
Attribute | Value |
---|---|
|
|
| The date and time when this item was created, in the following format: |
| One or more thesaurus entries. Each entry has the following attributes:
If If |
Example: add two entries to thesaurus
The following JSON adds two thesaurus entries to the thesaurus: a one-way entry that configures “digital” as a searchTerms
value and “digi” as a synonyms
value; and a multi-way entry that configures “adapter”, “converter”, and “adapter-converter” as synonyms of each other.
{ "ecr:type" : "thesaurus", "thesaurus-entries" : [ { "type": "one-way", "searchTerms": "digital", "synonym" : [ "digi" ] }, { "type": "multi-way", "synonyms": [ "converter","adapter","adapter-converter" ] } ] }
Thus:
If a shopper enters “digital” as a search term, records that include “digi” appear in the search results; but if a shopper enters “digi” as a search term, records that include “digital” do not appear in the search results.
If a shopper enters any of the words “ adapter”, “converter”, or “ adapter-converter” as a search term, records that contain any of the three words appear in the search results.