If you’ve ever used Power Automate or the SharePoint REST API, you’ve probably seen the mysterious $search parameter or the _api/search/query endpoint.
At first glance, $search might look like just another filter option — but it’s actually your gateway to SharePoint’s modern search engine, the same one that powers the site search bar and Microsoft Search results.
In this post, you’ll learn:
- What
$searchactually does - How it differs from
$filterand direct list queries - Real-world examples for Power Automate
- Performance and indexing details
- Best practices and limitations
Let’s dive in. 🧠
🧭 What Is $search in SharePoint?
The $search parameter (or _api/search/query) allows you to query SharePoint’s Search Index, not the live list or library data.
That means it doesn’t just search one list — it can search:
- Entire sites or site collections
- Document libraries and metadata
- Pages and wiki content
- People (user profiles)
- Even connected data sources if your tenant uses Microsoft Search connectors
In short:
$search= “Ask SharePoint’s search engine for everything related to this keyword.”
It’s similar to typing a word into the SharePoint search box, but you can automate and refine it via API or Power Automate.
⚙️ Basic REST Endpoint
The classic SharePoint Search endpoint looks like this:
GET https://yourtenant.sharepoint.com/sites/YourSite/_api/search/query?querytext='project plan'
This returns all indexed content in your site (or even tenant-wide, depending on permissions) that matches the words project plan.
💡 $search vs $filter — Key Difference
| Feature | $filter | $search |
|---|---|---|
| Where it runs | OData query (live list) | Search index (SharePoint Search service) |
| Speed | Depends on list size (slower for big lists) | Very fast (pre-indexed data) |
| Scope | One list or library | Whole site or tenant |
| Freshness | Real-time | May lag a few minutes |
| Supports ranking/relevance | ❌ No | ✅ Yes |
| Best for | Filtering structured data | Searching documents, pages, metadata |
🏎️ How Fast Is $search?
In most cases, $search is faster than $filter because:
- It queries pre-indexed content.
- It doesn’t hit live list data.
- It uses SharePoint’s search ranking engine.
However, it may not reflect very recent updates until the index refreshes (usually within 1–10 minutes).
✅ Great for document lookup, keyword discovery, and cross-site queries
❌ Not ideal for real-time or transactional data (e.g., workflow triggers)
🧩 Example 1 — Searching Across Lists
Endpoint:
GET https://yourtenant.sharepoint.com/sites/Projects/_api/search/query?querytext='Budget'
Response (simplified):
{
"PrimaryQueryResult": {
"RelevantResults": {
"Table": {
"Rows": [
{
"Cells": [
{ "Key": "Title", "Value": "Budget Report 2025" },
{ "Key": "Path", "Value": "https://.../Shared Documents/BudgetReport2025.xlsx" },
{ "Key": "Author", "Value": "John Doe" },
{ "Key": "LastModifiedTime", "Value": "2025-10-15T08:00:00Z" }
]
}
]
}
}
}
}
This pulls the most relevant “Budget” documents, whether they’re in libraries, pages, or even sub-sites.
🧩 Example 2 — $search in Power Automate
Action: “Send an HTTP request to SharePoint”
| Field | Value |
|---|---|
| Site Address | Your target site |
| Method | GET |
| Uri | _api/search/query?querytext='training'&rowlimit=5&selectproperties='Title,Path,Author,LastModifiedTime' |
You can then use a Parse JSON action to extract:
TitlePath(direct URL)AuthorLastModifiedTime
And display or email results automatically.
⚙️ Search Parameters You Should Know
| Parameter | Description | Example |
|---|---|---|
querytext | Your keyword or query | 'project plan' |
selectproperties | Which fields to return | Title,Path,Author,Size |
rowlimit | Max results (default = 500) | 10 |
trimduplicates | Remove duplicates | false |
refiners | Add facets like file type | filetype,modifiedby |
sortlist | Sorting by property | LastModifiedTime:descending |
Example: Limit and sort results
_api/search/query?querytext='report'&rowlimit=10&selectproperties='Title,Path,Author'&sortlist='LastModifiedTime:descending'
🧠 How Search Indexing Works
SharePoint continuously crawls and indexes site content.
By default:
- Indexed data updates within minutes of a change (not instantly).
- Some lists or columns may be excluded from search (check list settings).
- You can verify by going to List settings → Advanced settings → Search → “Allow items from this list to appear in search results.”
If you don’t see new content via $search, the index likely hasn’t refreshed yet.
🧰 Example 3 — Tenant-Wide Search with Microsoft Graph
If you need to search across multiple SharePoint sites (or even Teams files), use Microsoft Graph Search API:
POST https://graph.microsoft.com/v1.0/search/query
Content-Type: application/json
{
"requests": [
{
"entityTypes": ["driveItem", "listItem", "site"],
"query": { "queryString": "project plan" },
"from": 0,
"size": 10
}
]
}
This version unifies SharePoint, OneDrive, and Teams search — ideal for enterprise solutions.
⚡ Performance & Best Practices
| Tip | Why |
|---|---|
Use $search for broad keyword lookups | Faster and more flexible |
Combine $filter for structured logic | $search is not meant for numeric comparisons |
Always use rowlimit | Prevent massive result sets |
Use odata=nometadata headers | Cleaner, smaller responses |
Handle pagination (startrow) for >500 results | Default cap is 500 items |
Avoid “live filtering” with $search | Index delay may miss very recent changes |
🧭 When to Use $search
✅ Use $search when:
- You need to find documents or pages by keyword.
- You want to search across multiple lists/libraries.
- You want relevance-ranked results (not raw filters).
- You’re building a knowledge portal, content dashboard, or Power App with discovery features.
❌ Avoid $search when:
- You need up-to-the-second data.
- You’re doing exact numeric/date filtering.
- You’re updating/deleting items (use REST
_api/web/lists/...instead).
🧪 Example Use Case: “Document Finder” Flow
Imagine you want a Power Automate flow that:
- Accepts a search term (“Budget 2025”) from a Power Apps text box.
- Uses
$searchto find matching documents. - Emails the top 3 results to the user.
Steps:
- Trigger: “When PowerApps button pressed”
- Action: “Send an HTTP request to SharePoint”
_api/search/query?querytext='@{triggerBody()?['TextInput']}'&rowlimit=3&selectproperties='Title,Path,LastModifiedTime' - Parse JSON
- Create HTML table from results
- Send an email with table body
✅ Fast, easy, and scalable.
🔗 Useful Documentation
- SharePoint Search REST API Overview
- Working with HTTP Requests in Power Automate
- Microsoft Graph Search API Reference
🏁 Summary
| Aspect | $search Summary |
|---|---|
| Scope | Entire site / tenant |
| Speed | Fast (index-based) |
| Freshness | May lag a few minutes |
| Data Source | SharePoint Search Index |
| Ideal For | Document discovery, content search, cross-site lookups |
| Avoid For | Real-time or numeric filtering |
Think of
$searchas your Google for SharePoint — incredibly powerful when you need to find content, but not when you need to filter it.