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 Metadata and inherits its fields.

File Suffix and Directory Location 

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

Version 

Introduced in API version 61.0.

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 

channel 

  • Type: string

  • Required: Yes

  • Description: Required.

    The search channel that the configuration applies to.

masterLabel 

  • Type: string

  • Required: Yes

  • Description: Required.

    The name of the configuration.

objectOverride 

objectToAlwaysSearch 

  • Type: string[]
  • Required: No
  • Description: A list of the objects that are always searched for the user profile if the search channel is Einstein Global Search Bar.

profile 

  • Type: string
  • Required: No
  • Version: Removed in API version 62.0 and later.
  • Description: Specifies user profile if the search channel is Einstein Global Search Bar.

selectedObject 

  • Type: string[]
  • Required: No
  • Description: A list of the objects that are selected in the configuration if the search channel is LWR Experience Sites.

selectedProfile 

  • Type: string[]
  • Required: No
  • Introduced: API version 62.0
  • Description: Specifies all user profiles that are associated with a Search configuration if the search channel is Einstein Global Search Bar.

SearchCustomizationExplicitFilter Type 

Fields 

fieldPath 

  • Type: string
  • Required: No

type 

  • Type: string
  • Required: Yes

SearchCustomizationFieldOverride Type 

Represents the configuration for a specific field within an object.

Fields 

fieldApiName 

  • Type: string

  • Required: Yes

  • Description: Required.

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

searchable 

  • Type: boolean

  • Required: Yes

  • Description: Required.

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

SearchCustomizationObjectOverride Type 

Represents the configuration for a specific object.

Fields 

explicitFilter 

fieldOverride 

objectApiName 

  • Type: string

  • Required: Yes

  • Description: Required.

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

rule 

searchable 

  • Type: boolean
  • Required: No
  • Description: Indicates whether the object is searchable (true) or not (false).

SearchCustomizationRule Type 

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

Fields 

fieldApiName 

  • Type: string

  • Required: Yes

  • Description: Required.

    The field that the rule applies to.

operator 

  • Type: string

  • Required: Yes

  • Description: Required.

    The operator for the rule.

ruleValue 

SearchCustomizationRuleValue Type 

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

Fields 

targetObjectApiName 

  • Type: string
  • Required: No
  • Description: The API name of the target object, in case the rule applies to a lookup field.

value 

  • Type: string

  • Required: Yes

  • 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.