Skip to main content
Development

SOSL

SOSL Explained

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.

Related Salesforce Terms

Learn More

Ready to transform your Salesforce?

Join hundreds of teams using Clientell AI to automate workflows and boost productivity.

SOC2 Type II
Zero Data Retention
No Credit Card Required