Salesforce Dictionary - Free Salesforce GlossarySalesforce Dictionary
DictionarySSOSL (Salesforce Object Search Language)
DevelopmentBeginner

SOSL (Salesforce Object Search Language)

Salesforce Object Search Language, a search language that performs text searches across multiple objects simultaneously using the Salesforce search index, supporting wildcards, operators, and returning records from different objects in one query.

§ 01

Definition

Salesforce Object Search Language, a search language that performs text searches across multiple objects simultaneously using the Salesforce search index, supporting wildcards, operators, and returning records from different objects in one query.

§ 02

In plain English

👋 Study buddy

SOSL (Salesforce Object Search Language) is a search language that lets you search for text across multiple objects at once using the Salesforce search index. Unlike SOQL (which queries specific objects), SOSL does full-text search across many objects in a single query.

§ 03

Worked example

scenario · real-world use

A developer at Brackenwood Software needs to find any Salesforce record (across multiple objects) matching the search phrase "Acme Corp." Rather than running separate SOQL queries per object, he writes a SOSL query: FIND {Acme Corp} IN ALL FIELDS RETURNING Account(Id, Name), Contact(Id, FirstName, LastName), Opportunity(Id, Name). One round-trip returns matching records from all three objects. SOSL uses Salesforce's full-text search index - fast and capable of fuzzy matching - whereas SOQL is structured-query exact-match. SOSL is the right tool for global-search scenarios spanning many objects.

§ 04

Why SOSL (Salesforce Object Search Language) matters

SOSL (Salesforce Object Search Language) is a search language that performs text searches across multiple objects simultaneously using the Salesforce search index, supporting wildcards, operators, and returning records from different objects in one query. While SOQL queries specific objects with structured filters, SOSL searches across the search index for text matches, making it the right tool for find-the-needle scenarios.

SOSL and SOQL serve different purposes and complement each other. SOQL is for structured queries against known objects ('give me all accounts in California'). SOSL is for text search across many objects ('find anything mentioning Acme'). Mature Apex developers know when each is appropriate and choose accordingly. SOSL results come organized by object type, with customizable RETURNING clauses controlling which objects and fields appear.

§ 05

How organizations use SOSL (Salesforce Object Search Language)

CodeBridge

Trains developers on when to use SOSL versus SOQL, choosing based on the search pattern needed.

Quantum Labs

Uses SOSL in their global search customization for finding records across multiple objects.

TerraForm Tech

Combines SOSL with SOQL in their Apex code, using each where appropriate.

§

Trust & references

Official documentation

Straight from the source - Salesforce's reference material on SOSL (Salesforce Object Search Language).

Was this entry helpful?
Help us write better definitions. Quick reactions or detailed edit suggestions.
§

🧠 Test your knowledge

Q1. What is SOSL?

Q2. How does SOSL differ from SOQL?

Q3. When use SOSL?

§

Discussion

Loading…

Loading discussion…