WITH DATA CATEGORY DataCategorySpec
The WITH DATA CATEGORY clause can be used in API version 18.0 or later.
Syntax
The WITH DATA CATEGORY syntax is:
WITH DATA CATEGORY DataCategorySpec [logicalOperator DataCategorySpec2 ... ]
Where DataCategorySpec consists of a groupName, Operator, and category.
Name | Description |
---|---|
groupName | The name of the data category group to filter. For information on category groups, see “Create and Modify Category Groups” in the Salesforce Help. |
Operator | Use one of the following operators:
|
category | The name of the category to filter. To include multiple data categories, enclose them in parentheses, separated by commas. For information on categories, see “Add Data Categories to Category Groups” in the Salesforce Help. |
You can add multiple data category specifiers by using the logical operator AND. Other operators, such as OR and AND NOT, are not supported.
A SOSL statement using the WITH DATA CATEGORY clause must also include a RETURNING ObjectTypeName clause, with a WHERE clause that filters on the PublishStatus field.
- To search a specific article type, use the article type name with the suffix __kav
- To search all article types, use KnowledgeArticleVersion
- To search questions, use Question
- WHERE PublishStatus='online' for published articles
- WHERE PublishStatus='archived' for archived articles
- WHERE PublishStatus='draft' for draft articles
Examples
Search Type | Example |
---|---|
Search all published (online)Salesforce Knowledge articles with a category from one category group. |
|
Search online FAQ articles with categories from two category groups. |
|
Search archived FAQ articles from one category group. |
|
Search all draft Salesforce Knowledge articles from one category group. |
|
For information on the WITH DATA CATEGORY clause, see the WITH DATA CATEGORY filteringExpression.