Phrase Search
Phrase Search in Salesforce is the search syntax that matches a record only when the searchable fields contain a specific sequence of words in the same order.
Definition
Phrase Search in Salesforce is the search syntax that matches a record only when the searchable fields contain a specific sequence of words in the same order. The phrase is entered between double quotes: searching for "Acme Corporation Q1 renewal" matches records with that exact phrase but not records that contain the same words in a different order. Without the quotes, Salesforce treats the input as a keyword search and matches any record containing any of the words.
Phrase Search is the canonical way to find records when the order of words matters: a Knowledge article titled "How to reset a forgotten password," a Case with subject "delivery delay due to weather," a Contact named "John Smith Jr." All Salesforce search surfaces (global search, list view search, SOQL/SOSL text predicates) support the phrase syntax. The platform respects up to five phrases per search query before downgrading extra terms to keyword matching.
How Phrase Search works across Salesforce search surfaces
Phrase syntax: quotes, escape characters, and special cases
The phrase syntax is simple: wrap the text in double quotes. A search for "open case from Atlanta" matches records whose searchable fields contain that sequence of words. The platform ignores most punctuation inside the phrase, so "John's order" and "Johns order" produce identical matches. Single quotes are not phrase delimiters; only double quotes are. Inside a phrase, you can include wildcards: "Acme * Corp" matches "Acme Industrial Corp" and "Acme Pacific Corp" because the asterisk matches any single word in the middle of the phrase.
Stemming and how Salesforce relaxes the phrase match
Salesforce applies word stemming inside phrase searches. A search for "running shoes" also matches "run shoes" and "ran shoes" because the platform reduces "running" to its stem "run" before matching. This is usually helpful but occasionally surprising; a phrase that intentionally uses a specific tense ("ordered yesterday") will also match the present tense ("ordering yesterday"). Stemming is on by default and cannot be disabled on a per-query basis; it applies to English and most major languages the platform supports for search.
Stop words and the phrase boundary
Salesforce ignores stop words (common short words like "the", "a", "of", "in") inside phrase searches. A search for "case of the missing data" treats it as "case missing data" because "of" and "the" are stop words. This means the phrase syntax does not enforce strict adjacency for stop words; it enforces adjacency for content words. The behaviour matters most for Knowledge searches where article titles often contain stop words; the search engine deliberately relaxes the phrase boundary to surface more matches even when the exact stop-word order differs.
Where Phrase Search works: global search, SOSL, list views
Phrase Search works in three Salesforce surfaces. The first is global search: users typing into the search bar can wrap terms in double quotes to enforce phrase matching. The second is SOSL queries from Apex and the REST API: FIND with a quoted phrase inside the braces accepts the syntax for any object. The third is list view search and lookup search: typing a quoted phrase into the search box on a list view filters to records matching the phrase. SOQL LIKE predicates also accept phrases, though they use SQL-style percent wildcards rather than the phrase syntax.
Performance characteristics of phrase vs keyword search
Phrase searches are slightly more expensive than keyword searches because the platform has to enforce word order during the match. On large orgs with millions of records, the difference shows up in query time: a keyword search typically returns in under a second; a phrase search may take a few seconds when the phrase is uncommon and the index has to scan more rows to confirm adjacency. The performance impact is generally negligible for end users but matters for high-throughput integrations that issue many SOSL queries per second against the search tier.
The 5-phrase limit and how it interacts with complex queries
A single Salesforce search query can contain up to five phrase terms. Beyond that, the platform downgrades extra terms to keyword matching. The limit exists to keep search latency bounded; very complex phrase queries would otherwise take longer than the platform's search-tier service level allows. For integrations that need to find records matching many phrases, the working pattern is to split the work into multiple SOSL queries (one per group of five phrases) and union the results. Direct SOQL queries with LIKE predicates do not have the same limit but lack the SOSL index's speed advantage on large datasets.
When Phrase Search is the right tool vs alternatives
Phrase Search shines when the order of words matters and the user knows the exact phrase. For named entities (company names, product names, person names) the phrase syntax produces clean matches. For looser searches where any of several variants would be acceptable, keyword search is the right pick because it returns more results. For complex pattern matching (records with X but not Y, records where field A contains text matching format Z), the right tools are SOQL with multiple WHERE predicates, list view filters, or custom report types rather than Phrase Search.
Use Phrase Search across Salesforce surfaces
Phrase Search uses the same double-quote syntax everywhere it works. The steps below cover the most common surfaces and the patterns that produce reliable matches.
- Use Phrase Search in the global search bar
Wrap the search term in double quotes: typing "Acme Corp renewal" into the search bar at the top of any Salesforce page filters results to records containing the exact phrase. Without the quotes, the search matches any record with any of the words.
- Use Phrase Search in a SOSL query
Build a SOSL query that wraps the phrase in double quotes inside the FIND clause: the parser respects the double quotes as phrase delimiters. The same syntax works from Apex, REST API, and the Developer Console query editor.
- Use Phrase Search in a list view
Open a list view and type the phrase with double quotes into the search box at the top of the list. The list view filters to records matching the phrase in the searched fields, just like the global search but scoped to the list view's object.
- Combine Phrase Search with Boolean operators
Use AND and OR with phrases: "open case" AND "Atlanta" matches records containing both phrases. Boolean operators work between phrases the same way they work between keywords; NOT excludes phrases from results.
- Verify the match with a small test set
Run the phrase search and compare the results to what you expected. If the match list is too broad, the phrase may include a stop word that the platform ignored; rewrite to exclude stop words. If too narrow, drop to keyword search.
The canonical phrase syntax. Use for exact-order matching.
Asterisks inside the phrase match any single word in the position. Use for templated phrases where one word varies.
Combine phrases with AND, OR, NOT for compound queries. Up to five phrases per query.
- Salesforce applies stemming inside phrases, so "running" matches "run" and "ran". The behaviour cannot be turned off on a per-query basis.
- Stop words inside phrases (the, a, of, in) are ignored by the search engine. A phrase like "case of the day" matches "case day" too.
- A query is limited to five phrase terms. Beyond five, extra phrases downgrade to keyword search without an error message; very complex queries may need to be split across multiple SOSL calls.
Trust & references
Cross-checked against the following references.
- Search for PhrasesSalesforce Help
- SOSLSalesforce Developers
- How Does Salesforce Search Work?Salesforce Help
- Search OperatorsSalesforce Help
Straight from the source - Salesforce's reference material on Phrase Search.
- Phrase SearchSalesforce Help
- SOSL FIND SyntaxSalesforce Developers
Hands-on resources to go deeper on Phrase Search.
About the Author
Dipojjal Chakrabarti is a B2C Solution Architect with 29 Salesforce certifications and over 13 years in the Salesforce ecosystem. He runs salesforcedictionary.com to help admins, developers, architects, and cert/interview candidates sharpen their fundamentals. More about Dipojjal.
Test your knowledge
Q1. What is Phrase Search?
Q2. How do you use phrase search?
Q3. Why use phrase search?
Discussion
Loading discussion…