SOSL

Salesforce Object Search Language (SOSL) includes a new WITH SPELL_CORRECTION clause, and support for custom objects and fields using the WITH HIGHLIGHT clause.

WITH HIGHLIGHT Supports Custom Fields and Objects

Highlighting makes it easier for users to identify content. Specify which custom fields and objects are highlighted in search results.

The following statement returns search results with the search term salesforce west highlighted for the custom field BuildingDescription of the custom object Building.

FIND {Salesforce West} IN ALL FIELDS RETURNING Building__c(Name, BuildingDescription__c) WITH HIGHLIGHT

Disable Spell Correction on a Search Query with WITH SPELL_CORRECTION

Use WITH SPELL_CORRECTION = false to disable spell correction on a search query. When set to true, spell correction is enabled for searches that support spell correction. The default value is true.

The following SOSL statement disables spell correction on a search of accounts for the term San Francisco.

FIND {San Francisco} IN ALL FIELDS RETURNING Account WITH SPELL_CORRECTION = false