Newer Version Available

This content describes an older version of this product. View Latest

SOSL Limits

Your organization’s Salesforce data is indexed and retrieved in a way that returns the most relevant results to users.

However, it’s possible for users not to find all the matching results that they can access because the record that they’re looking for falls outside the maximum number of records searched.

The search engine processes SOSL searches in this order (the numbers in this list correspond to the numbers in the image below).
  1. The search engine looks for matches to the search term across a maximum number of records.
  2. SOSL then applies specific limits to objects or situations.

    In general, SOSL has the same limits that SOQL imposes and has an overall limit of 2,000 results returned, beginning with API version 28.0. Earlier versions return a maximum of 200 results.

    This results set can vary by user issuing the search, and can change over time.
    • Records that users accessed recently are more likely to be included in their search results.
    • The index can change throughout the day as users delete and create records.
  3. Administrators (users with the “View All Data” permission) see the full set of results returned, as specified in the RETURNING clause.
  4. Individual users see only those records that they have access to.

truncation and sharing rules can limit results users see

Example

For example, let’s say that each raindrop in the image above represents a record, each color represents an object, and the blue raindrop that’s falling outside the funnel represents the account record, “Acme, Inc.” In this example, the maximum number of matching records that are returned is 21 (represented by the number of raindrops falling into the funnel). When users search for “Acme, Inc.,” the search engine looks for matches until it reaches the limit of 21 matching records overall, which includes only the first 5 account records. Because “Acme, Inc.” is not included in the set of records that’s searched, it will not be included in the returned results, even if the user who’s searching has access to it.

SOSL Limits for External Objects

  • Only text, text area, and long text area fields on external objects can be searched. If an external object has no searchable fields, searches on that object return no records.
  • External objects don’t support logical operators in a FIND clause. The entire search query string is received by the remote system as a single phrase, with all non-alphanumeric characters removed. For example, FIND {MyProspect OR “John Smith”} searches for the exact phrase “MyProspect or John Smith”. We recommend that you set up the remote system to correctly interpret SOSL search query strings. If the remote system doesn’t have a full-text search index, the search query string is used as the substringof value in the $filter system query option. For example:
    1http://services.example.org/my/data/clients.svc/Prospects?$filter=substringof(‘MyProspect or John Smith’) eq true

    Learn more about the OData $filter system query option and other URI conventions at www.odata.org.

  • External objects don’t support the following.
    • INCLUDES operator
    • LIKE operator
    • EXCLUDES operator
    • toLabel() method
  • External objects also don’t support Salesforce Knowledge-specific clauses, including the following.
    • UPDATE TRACKING clause
    • UPDATE VIEWSTAT clause
    • WITH DATA CATEGORY clause