You can add two kinds of entries to your thesaurus:

The following table describes the JSON attributes that configure a thesaurus and thesaurus entries.

Attribute

Value

ecr:type

The ecr-type of the node. The value can be thesaurus or thesaurus-entry. Required.

id

Can be generated by the system or specified by the user. Required for operations on a thesaurus entry.

thesaurus-entry

Each entry has the following attributes:

Type (string, required). The supported values are:

one-way: Specifies a single thesaurus entry for the searchTerms value. If entered as a search term, a searchTerms value matches the synonyms value; but a synonyms value, if entered as a search term, does not match a searchTerms value.

multi-way: Specifies a list of synonyms, any one of which, if entered as a search term, matches any of the other synonyms. Note: In Oracle Commerce Cloud, the term equivalent is used in place of multi-way. For information, see Using Oracle Commerce Cloud.

searchTerms (string) Required if the Type value is one-way. Not used if the entry type is multi-way.

synonyms (string or string[], required). The synonyms values are treated in the following ways:

If type is one-way, the synonyms value is a single word or phrase that is considered a match for the searchTerm value.

If type is multi-way, the synonyms value is a set of two or more words or phrases, any one of which is considered a match for any of the others when entered by the user as a search term.

Example: thesaurus with two thesaurus-entry objects

The following JSON illustrates the configuration of a thesaurus object containing two thesaurus-entry objects: a one-way entry that configures “shirt” as a searchTerms value and “blouse” as a synonyms value; and a multi-way entry that configures “adapter”, “converter”, and “adapter-converter” as synonyms of each other. Note that the ID of one thesaurus-entry object was generated by the system and the other was specified by the user; for information about how to specify the IDs of thesaurus-entry objects, see Create thesaurus entries.

{
  "ecr:type" : "thesaurus",
  "auto_generated_id":
   {
      "ecr:type": "thesaurus-entry",
      "type": "one-way",
      "searchTerms": "shirt",
      "synonyms" : ["blouse"]
    },
    "user_specified_id":
   {
      "ecr:type": "thesaurus-entry",
      "type": "multi-way",
      "synonyms": [
        "converter","adapter","adapter-converter"
      ]
    }
}

Thus:

  • If a shopper enters “shirt” as a search term, records that include “blouse” appear in the search results; but if a shopper enters “blouse” as a search term, records that include “shirt” 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.


Copyright © 1997, 2017 Oracle and/or its affiliates. All rights reserved. Legal Notices