---
schema_version: "1"
id: 508a03e3c6dca1fedb188f4bca69f7c20f8c33a887baaf94c3c675e1945feaee
title: IN SearchGroup
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform/salesforce-soql-sosl/guides/soql-sosl/sforce-api-calls-sosl-in.md
canonical_url: https://developer.salesforce.com/docs/platform/salesforce-soql-sosl/guide/sforce-api-calls-sosl-in.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: a49b65f455cf6e52df41d0f414239f0806da91b913c1d27e92468622996bbffd
products:
  - SOQL and SOSL Reference
  - Platform Developer Content
---

# IN SearchGroup

In an SOSL query, you can specify which types of text fields to search for using the IN _SearchGroup_ optional clause. The _SearchGroup_ defines the scope of the search. For example, you can search for name, email, phone, sidebar, or all fields.

The following table lists the valid SearchGroup values. If you don’t specify a value, the default behavior is to search all text fields in searchable objects. Numeric fields aren’t searchable.

**note:** This clause doesn’t apply to articles, documents, feed comments, feed items, files, products, and solutions. If these objects are specified in the RETURNING clause, the search is not limited to specific fields, and all fields are searched.

## Valid SearchGroup Settings

| SearchGroup      | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| ---------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `ALL FIELDS`     | Search all searchable fields. If the `IN` clause is unspecified, then `ALL FIELDS` is the default setting.                                                                                                                                                                                                                                                                                                                                                                         |
| `EMAIL FIELDS`   | Search only email fields.                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| `NAME FIELDS`    | Search only name fields for standard objects. In addition to the Name field, Salesforce searches additional fields when using `IN NAME FIELDS` with certain standard objects (see the list after this table). In custom objects, fields that are defined as “Name Field” are searched. In standard and custom objects, name fields have the `nameField` property set to `true`. (See the Field array of the `fields` parameter of the DescribeSObjectResult for more information.) |
| `PHONE FIELDS`   | Search only phone number fields.                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| `SIDEBAR FIELDS` | Search for valid records as listed in the Sidebar dropdown list. Unlike search in the application, the asterisk (\*) wildcard isn’t appended to the end of a search string.                                                                                                                                                                                                                                                                                                        |

In addition to the Name field, Salesforce searches the following fields when using `IN NAME FIELDS` with these standard objects:

- Account: Website, Site, NameLocal
- Asset: SerialNumber
- Case: SuppliedName, SuppliedCompany, Subject
- Contact: AssistantName, FirstNameLocal, LastNameLocal, AccountName
- Event: Subject
- Lead: Company, CompanyLocal, FirstNameLocal, LastNameLocal
- Note: Title
- PermissionSet: Label
- Report: Description
- TagDefinition: NormName
- Task: Subject
- User: CommunityNickname

The `IN` clause is optional, but it limits the search scope, making the search more efficient. For example, to search only for an email address, specify `IN EMAIL FIELDS`.

## Examples of IN Clauses

| Search Type      | Examples                                       |
| ---------------- | ---------------------------------------------- |
| No search group  | `FIND {MyProspect}`                            |
| `ALL FIELDS`     | `FIND {MyProspect} IN ALL FIELDS`              |
| `EMAIL FIELDS`   | `FIND {mylogin@mycompany.com} IN EMAIL FIELDS` |
| `NAME FIELDS`    | `FIND {MyProspect} IN NAME FIELDS`             |
| `PHONE FIELDS`   | `FIND {MyProspect} IN PHONE FIELDS`            |
| `SIDEBAR FIELDS` | `FIND {MyProspect} IN SIDEBAR FIELDS`          |
| Invalid search   | `FIND {MyProspect} IN Accounts`                |
