SynonymDictionary

Represents a set of synonym groups, which are groups of words or phrases that are treated as equivalent in users’ searches. You can define synonym groups to optimize search results for acronyms, variations of product names, and other terminology unique to your organization.

Synonyms are available in Service Cloud features such as Salesforce Knowledge.

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

SynonymDictionary components have the suffix .synonymDictionary and are stored in the synonymDictionaries folder.

Version 

Introduced in API version 29.0.

Special Access Rules 

Synonyms must be enabled in your organization. Only users with the “Manage Synonyms” permission can access this object.

Fields 

groups 

  • Type: SynonymGroup[]
  • Required: No
  • Description: The synonym groups defined in this dictionary.

isProtected 

  • Type: boolean
  • Required: No
  • Description: Indicates whether this component is protected (true) or not (false). Protected components cannot be linked to or referenced by components created in the installing organization.

label 

  • Type: string
  • Required: Yes
  • Description: Required. Specifies the display name of the synonym dictionary.

SynonymGroup Type 

Represents a group of synonymous words or phrases.

Fields 

languages 

  • Type: Language (enumeration of type string)[]
  • Required: No
  • Description: Required. Specifies the languages the synonym group applies to. If synonyms are specific to a single language, specify only that language. If the synonyms apply to multiple languages, specify multiple languages for one synonym group.

terms 

  • Type: string[]

  • Required: No

  • Description: Required. A word or phrase synonymous with other terms in the group. Maximum of 50 characters. Minimum of two terms per group.

    Synonym groups are symmetric, which means that if oranges and apples are defined in a synonym group, a search for oranges will return a match for apples, and vice versa for a search for apples.

Declarative Metadata Sample Definition 

The following is an example of a SynonymDictionary component:

1<?xml version="1.0" encoding="UTF-8"?>
2<SynonymDictionary xmlns="http://soap.sforce.com/2006/04/metadata">
3    <groups>
4        <languages>en_US</languages>
5        <terms>Salesforce</terms>
6        <terms>salesforce.com</terms>
7        <terms>The Customer Company</terms>
8        <terms>SFDC</terms>
9    </groups>
10    <groups>
11        <languages>fr</languages>
12        <terms>renault</terms>
13        <terms>clio</terms>
14    </groups>
15    <label>Sample Dictionary</label>
16</SynonymDictionary>

The following is an example package.xml that references the SynonymDictionary component.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <members>Sample Dictionary</members>
5        <name>SynonymDictionary</name>
6    </types>
7    <version>68.0</version>
8</Package>

Usage 

If you have existing synonym groups defined before API version 29.0, your existing groups are associated with a default dictionary called _Default.

If you have a set of synonyms that require frequent updates, we recommend assigning the synonym group or groups to a dedicated dictionary with a small number of groups. Each time you deploy an existing dictionary, all of its synonym groups are overwritten. We don’t support deploying updates to only a single synonym group within a dictionary.

Wildcard Support in the Manifest File 

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.