KnowledgeSuggestionFilter Class
Filter settings that narrow the results from a call to System.Search.suggest(searchQuery, sObjectType, options) when the SOSL search query contains a KnowledgeArticleVersion object.
The following are methods for KnowledgeSuggestionFilter.
-
Adds a filter that narrows suggestion results to display the specified article type. This filter is optional.
-
addDataCategory(dataCategoryGroupName, dataCategoryName)
Adds a filter that narrows suggestion results to display articles in the specified data category. This filter is optional.
-
Specifies the article topic to return. This filter is optional.
-
Sets a channel to narrow the suggestion results to articles in the specified channel. This filter is optional.
-
setDataCategories(dataCategoryFilters)
Adds filters that narrow suggestion results to display articles in the specified data categories. Use this method to set multiple data category group and name pairs in one call. This filter is optional.
-
Sets a language to narrow the suggestion results to display articles in that language. This filter value is required in calls to
System.Search.suggest(String, String, Search.SuggestionOption). -
setPublishStatus(publishStatus)
Sets a publish status to narrow the suggestion results to display articles with that status. This filter value is required in calls to
System.Search.suggest(String, String, Search.SuggestionOption). -
setValidationStatus(validationStatus)
Sets a validation status to narrow the suggestion results to display articles with that status. This filter is optional.
Adds a filter that narrows suggestion results to display the specified article type. This filter is optional.
public void addArticleType(String articleType)
- articleType: Type: String A three-character ID prefix indicating the desired article type.
Type: void
To add more than 1 article type, call the method multiple times.
Adds a filter that narrows suggestion results to display articles in the specified data category. This filter is optional.
public void addDataCategory(String dataCategoryGroupName, String dataCategoryName)
- dataCategoryGroupName: Type: String The name of the data category group
- dataCategoryName: Type: String The name of the data category.
Type: void
To set multiple data categories, call the method multiple times. The name of the data category group and name of the data category for desired articles, expressed as a mapping, for example, Search.KnowledgeSuggestionFilter.addDataCategory('Regions', 'Asia').
Specifies the article topic to return. This filter is optional.
public void addTopic(String topic)
- addTopic: Type: String The name of the article topic.
Type: void
To add more than 1 article topic, call the method multiple times.
Sets a channel to narrow the suggestion results to articles in the specified channel. This filter is optional.
public void setChannel(String channelName)
-
channelName: Type: String The name of a channel. Valid values are:
AllChannels–Visible in all channels the user has access toApp–Visible in the internal Salesforce Knowledge applicationPkb–Visible in the public knowledge baseCsp–Visible in the Customer PortalPrm–Visible in the Partner Portal
If
channelisn’t specified, the default value is determined by the type of user.If
channelis specified, the specified value may not be the actual value requested, because of certain requirements.
Type: void
Adds filters that narrow suggestion results to display articles in the specified data categories. Use this method to set multiple data category group and name pairs in one call. This filter is optional.
public void setDataCategories(Map dataCategoryFilters)
- dataCategoryFilters: Type: Map A map of data category group and data category name pairs.
Type: void
Sets a language to narrow the suggestion results to display articles in that language. This filter value is required in calls to System.Search.suggest(String, String, Search.SuggestionOption).
public void setLanguage(String localeCode)
- localeCode: Type: String A locale code. For example,
'en_US'(English–United States), or'es'(Spanish).
Type: void
See Also
Sets a publish status to narrow the suggestion results to display articles with that status. This filter value is required in calls to System.Search.suggest(String, String, Search.SuggestionOption).
public void setPublishStatus(String publishStatus)
-
publishStatus: Type: String A publish status. Valid values are:
-
Draft–Articles aren’t published in Salesforce Knowledge. -
Online–Articles are published in Salesforce Knowledge. -
Archived–Articles aren’t published and are available in Archived Articles view.
Sets a validation status to narrow the suggestion results to display articles with that status. This filter is optional.
public void setValidationStatus(String validationStatus)
- validationStatus: Type: String An article validation status. These values are available in the
ValidationStatusfield on the KnowledgeArticleVersion object.
Type: void