Skip to main content
Development

What is SOSL in Salesforce?

SOSL (Salesforce Object Search Language) is a text-search language that looks across several objects in one call and returns a list of lists. Apex allows 20 SOSL queries per transaction, separate from the SOQL limit.

Clientell AI, the AI Salesforce admin, helps with SOSL in a sandbox: it writes and tests the code, and shows it to you before anything deploys. See Apex and query generation

Try it in Clientell AI

“Write a SOSL example for my Account object, test it in a sandbox, and show me the code before anything deploys.”

Clientell reads your org first, drafts every change, and changes nothing until you approve. Platform deployments include rollback. How security works.

Start the 14-day free trial, no card

Term Context

Category

Development

10 terms in this category

Related Terms

3

connected concepts

Glossary

66

total definitions

How does SOSL work in Salesforce?

Unlike SOQL, which queries a single object at a time (plus related objects through relationship fields), SOSL performs a full-text search across multiple objects in a single call. It returns a list of lists (one list per sObject type searched) and supports FIND clauses with wildcards, proximity operators, and logical operators (AND, OR, AND NOT). SOSL searches run against Salesforce's search index, which is updated asynchronously, so very recently created records may not appear immediately.

SOSL is ideal for global search scenarios, such as finding a contact name that might appear across Leads, Contacts, and custom objects. In Apex, SOSL queries count against a separate governor limit (20 per transaction) from SOQL. Developers frequently use SOSL in search pages, de-duplication utilities, and knowledge-base lookups where the target object is unknown ahead of time.

Questions people ask

What is the full form of SOSL in Salesforce?

Salesforce Object Search Language.

What is the difference between SOQL and SOSL?

SOQL reads records from one object and its relations. SOSL runs a text search across several objects and returns a list of lists.

How many SOSL queries can Apex run in one transaction?

20. SOSL has its own governor limit, separate from SOQL.

Why is a new record missing from my SOSL results?

SOSL reads the search index, which updates asynchronously. A record created seconds ago may not show up yet.

Getting Started

Try this on your own org

Start the 14-day free trial, no card. Clientell scans read-only first and changes nothing until you approve.

14-day free trial  ·  No credit card required

SOC 2
HIPAA
GDPR
Salesforce Partner