Salesforce Knowledge Metadata API SearchSettings
Metadata API has no concept of the order of the changes made to the sandbox organization. It just deploys the changes from one organization to another. During the deployment, it first notices the deletion of the FR category and removes it from the production organization. Consequently, it moves associations for any records from FR to its parent on the production organization, EMEA . Metadata
API then adds the
EU
category and moves
SP
and
UK
below it. Although the category group hierarchy looks the same in both organizations, record categorization in production is different from the sandbox organization. The records that were originally associated with FR in hierarchy 1 are associated with EU in the sandbox organization, but are associated with EMEA in the production organization.
SearchSettings
Represents an org's search settings.
This type extends the Metadata metadata type and inherits its fullName
field.
In the package manifest, all organization settings metadata types are accessed using the “Settings” name. See Settings for more details.
File Suffix and Directory Location
SearchSettings values are stored in a single file named
Search.settings
in the settings
folder. The
.settings
files are different from other named components because there is only one settings file for each settings component.
Version
SearchSettings is available in API version 37.0 and later.
Fields
Field Name documentContentSearchEnabled optimizeSearchForCJKEnabled
Field Type boolean boolean
Description
Indicates if a full-text document search is performed.
Indicates whether the search is optimized for the Japanese,
Chinese, and Korean languages. This setting affects sidebar
157
Salesforce Knowledge Metadata API SearchSettings
Field Name sidebarDropDownListEnabled
Field Type recentlyViewedUsersForBlankLookupEnabled searchSettingsByObject sidebarAutoCompleteEnabled boolean Indicates whether the list of records that are returned from a user autocomplete lookup and from a blank user lookup is taken from the user’s recently viewed user records. Otherwise this setting is false
if the lookup shows a list of recently accessed user records from across your org ( false ). Only applies to User object blank lookup searches.
SearchSettingsByObject
Represents a list of search settings for each object.
boolean Indicates if autocomplete is enabled for sidebar search.
Autocomplete is when users start typing search terms and sidebar search displays a matching list of recently viewed records.
boolean
Description search and the account search for Find Duplicates on a lead record in sidebar search and global search. Enable this option if users are searching mostly in Japanese, Chinese, or Korean, and if the text in searchable fields is mostly in those languages.
sidebarLimitToItemsIOwnCheckboxEnabled singleSearchResultShortcutEnabled spellCorrectKnowledgeSearchEnabled boolean boolean boolean
Indicates if a drop-down list appears in the sidebar search section. From this list, users can select to search within tags, within a specific object, or across all objects.
Indicates if the Limit to Items I Own checkbox appears. The checkbox allows your users to include only records for which they are the record owner when entering search queries in the sidebar.
Indicates if a shortcut is enabled. With the shortcut, users skip the search results page and go directly to the record’s detail page when their search returns only a single item. This setting doesn't apply to tags, case comments (in advanced search), and global search.
Indicates if spell check is enabled for Knowledge search.
SearchSettingsByObject
Includes ObjectSearchSetting field type, which is a list of search settings for each object.
Field Name searchSettingsByObject
Field Type Description
ObjectSearchSetting
Contains a list of search settings for each object.
ObjectSearchSetting
A list of search settings for each object.
158
Salesforce Knowledge Metadata API SearchSettings
Field Name enhancedLookupEnabled
Field Type boolean lookupAutoCompleteEnabled boolean name resultsPerPageCount string int
Description
Indicates if enhanced lookups is enabled for the object.
Indicates if autocomplete is enabled for lookup search. Autocomplete is when users edit the lookup field inline by choosing an autosuggestion.
The entity name of the object being configured.
The number of search results per page.
Declarative Metadata Sample Definition
The following is an example of the Search.settings
file.
<?xml version="1.0" encoding="UTF-8"?>
<SearchSettings xmlns="http://soap.sforce.com/2006/04/metadata">
<documentContentSearchEnabled>true</documentContentSearchEnabled>
<optimizeSearchForCJKEnabled>true</optimizeSearchForCJKEnabled>
<recentlyViewedUsersForBlankLookupEnabled>true</recentlyViewedUsersForBlankLookupEnabled>
<searchSettingsByObject>
<searchSettingsByObject>
<enhancedLookupEnabled>false</enhancedLookupEnabled>
<lookupAutoCompleteEnabled>false</lookupAutoCompleteEnabled>
<name>Account</name>
<resultsPerPageCount>25</resultsPerPageCount>
</searchSettingsByObject>
<searchSettingsByObject>
<enhancedLookupEnabled>false</enhancedLookupEnabled>
<lookupAutoCompleteEnabled>false</lookupAutoCompleteEnabled>
<name>Activity</name>
<resultsPerPageCount>25</resultsPerPageCount>
</searchSettingsByObject>
<searchSettingsByObject>
<enhancedLookupEnabled>false</enhancedLookupEnabled>
<lookupAutoCompleteEnabled>false</lookupAutoCompleteEnabled>
<name>Asset</name>
<resultsPerPageCount>25</resultsPerPageCount>
</searchSettingsByObject>
</searchSettingsByObject>
<sidebarAutoCompleteEnabled>true</sidebarAutoCompleteEnabled>
<sidebarDropDownListEnabled>true</sidebarDropDownListEnabled>
<sidebarLimitToItemsIOwnCheckboxEnabled>true</sidebarLimitToItemsIOwnCheckboxEnabled>
<singleSearchResultShortcutEnabled>true</singleSearchResultShortcutEnabled>
<spellCorrectKnowledgeSearchEnabled>true</spellCorrectKnowledgeSearchEnabled>
</SearchSettings>
159