SearchCustomization

Represents the configuration of search settings created in Search Manager. The configuration includes the search channel, searchable objects and fields, and rules to filter search results.

Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.

Important

Parent Type

This type extends the Metadata metadata type and inherits its fullName field.

File Suffix and Directory Location

SearchCustomization components have the suffix .searchCustomization and are stored in the searchCustomizations folder.

Version

SearchCustomization components are available in API version 61.0 and later.

Special Access Rules

Only users with the View Setup and Configuration permission can access this object, and only users with the Customize Application permission can edit it.

Fields

Field Name Description
channel
Field Type
string
Description

Required.

The search channel that the configuration applies to.

masterLabel
Field Type
string
Description

Required.

The name of the configuration.

objectOverride
Field Type
SearchCustomizationObjectOverride[]
Description
A list of object configurations.
objectToAlwaysSearch
Field Type
string[]
Description
A list of the objects that are always searched for the user profile if the search channel is Einstein Global Search Bar. 
profile
Field Type
string
Description
Specifies user profile if the search channel is Einstein Global Search Bar. 
selectedObject
Field Type
string[]
Description
A list of the objects that are selected in the configuration if the search channel is LWR Experience Sites.
selectedProfile
Field Type
string[]
Description
Specifies all user profiles that are associated with a Search configuration if the search channel is Einstein Global Search Bar. This field is available in API version 62.0 and later.

SearchCustomizationObjectOverride

Represents the configuration for a specific object.

Field Name Description
fieldOverride
Field Type
SearchCustomizationFieldOverride[]
Description
A list of field configurations.
objectApiName
Field Type
string
Description

Required.

The API name of the object that the configuration is applied to.

rule
Field Type
SearchCustomizationRule[]
Description
A list of rules applied to filter search results. 
searchable
Field Type
boolean
Description
Indicates whether the object is searchable (true) or not (false).

SearchCustomizationFieldOverride

Represents the configuration for a specific field within an object.

Field Name Description
fieldApiName
Field Type
string
Description

Required.

The API name of the field that the configuration is applied to.

searchable
Field Type
boolean
Description

Required.

Indicates whether the field is searchable (true) or not (false).

SearchCustomizationRule

Represents the rules defined in an object to filter search results.

Field Name Description
fieldApiName
Field Type
string
Description

Required.

The field that the rule applies to. 

operator
Field Type
string
Description

Required.

The operator for the rule.

ruleValue
Field Type
SearchCustomizationRuleValue[]
Description
A list of rule values. 

SearchCustomizationRuleValue

Represents the value of a rule used to filter search results.

Field Name Description
targetObjectApiName
Field Type
string
Description
The API name of the target object, in case the rule applies to a lookup field.
value
Field Type
string
Description

Required.

The value of the rule.

Declarative Metadata Sample Definition

The following is an example of a SearchCustomization component.

1<?xml version="1.0" encoding="UTF-8"?>
2<SearchCustomization xmlns="http://soap.sforce.com/2006/04/metadata">
3    <channel>GlobalSearch</channel>
4    <masterLabel>My_Standard_User_Configuration</masterLabel>
5    <objectOverride>
6        <fieldOverride>
7            <fieldApiName>Description</fieldApiName>
8            <searchable>false</searchable>
9        </fieldOverride>
10        <fieldOverride>
11            <fieldApiName>Rating</fieldApiName>
12            <searchable>true</searchable>
13        </fieldOverride>
14        <objectApiName>Account</objectApiName>
15        <rule>
16            <fieldApiName>My_Custom_Field__c</fieldApiName>
17            <operator>ne</operator>
18            <ruleValue>
19                <value>Other</value>
20            </ruleValue>
21        </rule>
22        <rule>
23            <fieldApiName>Rating</fieldApiName>
24            <operator>in</operator>
25            <ruleValue>
26                <value>Hot</value>
27            </ruleValue>
28            <ruleValue>
29                <value>Warm</value>
30            </ruleValue>
31        </rule>
32    </objectOverride>
33    <objectOverride>
34        <objectApiName>Asset</objectApiName>
35        <searchable>false</searchable>
36    </objectOverride>
37    <objectOverride>
38        <objectApiName>Contact</objectApiName>
39        <rule>
40            <fieldApiName>AccountId</fieldApiName>
41            <operator>ne</operator>
42            <ruleValue>
43                <targetObjectApiName>Account</targetObjectApiName>
44                <value>A Company</value>
45            </ruleValue>
46        </rule>
47        <rule>
48            <fieldApiName>DoNotCall</fieldApiName>
49            <operator>eq</operator>
50            <ruleValue>
51                <value>false</value>
52            </ruleValue>
53        </rule>
54    </objectOverride>
55    <objectToAlwaysSearch>Account</objectToAlwaysSearch>
56    <objectToAlwaysSearch>Contact</objectToAlwaysSearch>
57    <objectToAlwaysSearch>My_Custom_Object__c</objectToAlwaysSearch>
58    <objectToAlwaysSearch>Product2</objectToAlwaysSearch>
59    <profile>standard</profile>
60</SearchCustomization>

The following is an example package.xml that references the previous definition.

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

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.