The examples in this section use REST API resources to search and query records using Salesforce Object Search Language (SOSL) and Salesforce Object Query Language (SOQL), and other search APIs.
Use the Query resource to execute a SOQL query that returns all the results in a single response, or if needed, returns part of the results and a locator used to retrieve the remaining results.
Use the QueryAll resource to execute a SOQL query that includes information about records that have been deleted because of a merge or delete. Use QueryAll rather than Query, because the Query resource will automatically filter out items that have been deleted.
To get feedback on how Salesforce executes your query, report, or list view, use the Query resource along with the explain parameter. Salesforce analyzes each query to find the optimal approach to obtain the query results. Depending on the query and query filters, Salesforce uses an index or internal optimization. To return details on how Salesforce optimizes your query, without actually running the query, use the explain parameter. Based on the response, decide whether to fine-tune the performance of your query, like adding filters to make the query more selective.
Use the Search Scope and Order resource to retrieve the default global search scope and order for the logged-in user, including any pinned objects in the user’s search results page.