---
schema_version: "1"
id: de656b1a4466ae6e7d0f63499189a01044dce94aa06114e76ddde7159eeacec8
title: SearchResults Class
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/apexref/apex_class_Search_SearchResults.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Search_SearchResults.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 61b8d434583c4495ef0071eecce8f9becb0723ee4ada1bdcf58efb5f25e28ddc
description: Wraps the results returned by the Search.find(String​) method.Returns a list of Search.SearchResult objects that contain an sObject of the specified type.
---
# SearchResults Class

Wraps the results returned by the Search.find(String​) method.

## Namespace

[Search](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_namespace_Search.htm#apex_namespace_Search "The Search namespace provides classes for getting search results and suggestion results.")

## SearchResults Methods

The following are methods for SearchResults.

- **[get(sObjectType)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Search_SearchResults.htm#apex_Search_SearchResults_get)**  
    Returns a list of Search.SearchResult objects that contain an sObject of the specified type.

### get(sObjectType)

Returns a list of Search.SearchResult objects that contain an sObject of the specified type.

#### Signature

public List<Search.SearchResult> get(String sObjectType)

#### Parameters

- **sObjectType**: Type: [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm#apex_methods_system_string "Contains methods for the String primitive data type.") The name of an sObject in the dynamic SOSL query passed to the Search.find(String) method.

#### Return Value

Type: [List](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm#apex_methods_system_list "Contains methods for the List collection type.")<[Search.SearchResult](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Search_SearchResult.htm#apex_class_Search_SearchResult "A wrapper object that contains an sObject and search metadata.")\>

#### Usage

SOSL queries passed to the Search.find(String) method can return results for multiple objects. For example, the query Search.find('FIND \\'map\\' IN ALL FIELDS RETURNING Account, Contact, Opportunity') includes results for 3 objects. You can call get(string) to retrieve search results for 1 object at a time. For example, to get results for the Account object, call Search.SearchResults.get('Account').

#### See Also

- [find(searchQuery)](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_search.htm#apex_System_Search_find "Performs a dynamic SOSL query that can include the SOSL WITH SNIPPET clause. Snippets provide more context for users in Salesforce Knowledge article search results.")
- [SearchResult Methods](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Search_SearchResult.htm#apex_Search_SearchResult_methods)
- [_Apex Developer Guide_: Dynamic SOSL](https://developer.salesforce.com/docs/atlas.en-us.264.0.apexcode.meta/apexcode/apex_dynamic_sosl.htm "Apex Developer Guide: Dynamic SOSL - HTML (New Window)")