SOSL uses the following syntax:
FIND {SearchQuery}[ toLabel()] [ IN SearchGroup [ convertCurrency(Amount)] ] [ RETURNING FieldSpec ] [ WITH DivisionFilter ] [ WITH DATA CATEGORY DataCategorySpec ] [ LIMIT n ]
where:
| Syntax | Description |
|---|---|
| FIND {SearchQuery} | Required. Specifies the text (words or phrases) to search for. The search query must be delimited with curly braces. |
| toLabel() | Optional. Results from a query are returned translated into the user’s language. |
| IN SearchGroup | Optional. Scope of fields to search. One of the following values:
|
| convertCurrency(Amount) | Optional. If an organization is multicurrency enabled, converts currency fields to the user's currency. |
| RETURNING FieldSpec | Optional. Information to return in the search result. List of one or more objects and, within each object, list of one or more fields, with optional values to filter against. If unspecified, then the search results contain the IDs of all objects found. |
| WITH DivisionFilter | Optional. If an organization uses divisions, filters all search results based on values for the Division field. |
| WITH DATA CATEGORY DataCategorySpec | Optional. If an organization uses Salesforce Knowledge articles or answers, filters all search results based on one or more data categories. |
| LIMIT n | Optional. Specifies the maximum number of rows returned in the text query, up to 200. If unspecified, the default is 200, the largest number of rows that can be returned. |