You need a single place to review all company policies stored across multiple SharePoint document libraries. Manually browsing each site is slow and error-prone. SharePoint search-based views let you build a dynamic list that pulls content from any site based on keywords or metadata. This article explains how to create a search-based view for policies and how to set it up step by step.
Key Takeaways: Search-Based View for Policies
- Search Results Web Part: Displays policy documents from all indexed sites using a custom query.
- Query builder in SharePoint admin center: Refines results by content type, site path, or managed property.
- Refinement Web Part: Adds filters for department, year, or status to narrow results.
What a Search-Based View Does and What You Need Before You Start
A search-based view is a page that uses the Search Results Web Part to show documents matching a specific query. Instead of browsing each library, the view aggregates policy documents from all sites that SharePoint has indexed. The query runs each time the page loads, so the list is always current.
Before you build the view, confirm these prerequisites:
- You have at least Contribute permission on the site where you will add the search-based view.
- SharePoint Search is enabled for your tenant. It is enabled by default in Microsoft 365.
- Policy documents are stored in libraries that are set to allow indexing. Most modern libraries are indexed automatically.
- You know which metadata or keyword identifies a document as a policy. Examples: content type “Policy Document”, a specific managed property like “PolicyDepartment”, or a keyword in the title.
How Search Indexing Works for Policies
SharePoint crawls document libraries and builds a search index. The index includes file name, title, metadata, and full-text content. When you create a search-based view, you write a query that tells SharePoint which indexed items to show. The query can use keywords, managed properties, or a combination. For policies, you typically filter by content type or a custom column like “Document Type” set to “Policy”.
Steps to Create a Search-Based View for Policies
Follow these steps to build a search-based view that displays policy documents from all indexed sites.
- Identify the Policy Content Type or Metadata
Open a document library that contains policies. Check the column values that distinguish policies from other documents. If you use a content type, note its name exactly as it appears in the library settings. If you use a managed property like “PolicyDepartment”, confirm the property is mapped and crawled. Go to SharePoint admin center > Search > Managed Properties to verify. - Create a New Site Page
Navigate to the site where you want the search-based view. Select Pages > New > Site Page. Give the page a name such as “Policy Search View”. Click Create. - Add the Search Results Web Part
On the new page, click the Edit icon. In the canvas, select the plus sign to add a web part. Search for “Search Results” and select it. The web part will show default search results. - Configure the Query
Click the web part and select Edit Web Part. In the tool pane, under Query Builder, choose “Show more”. Set the Query text to a search query that returns only policy documents. For example:contenttype:"Policy Document"
If you use a custom column, use its managed property name. For a column named “DocumentType”, the query might be:DocumentType:"Policy"
Click Test Query to verify results. Adjust the query until only policy documents appear. - Set the Result Source (Optional)
If you want to limit results to a specific site collection or library, click “Select a result source”. Choose “Local SharePoint Results” or create a custom result source that restricts the search scope. For example, a result source with the path filterpath:"https://contoso.sharepoint.com/sites/policies". - Add Refinement Web Part for Filtering
To let users filter by department, year, or other metadata, add a Refinement Web Part. Click the plus sign, search for “Refinement”, and select it. In the web part settings, choose the managed properties you want as filters. For example, “PolicyDepartment” and “PolicyYear”. Connect the Refinement Web Part to the Search Results Web Part by selecting “Connect Web Parts” from the web part menu. - Set the Result Type Display Template (Optional)
To show policy-specific information like effective date or owner, change the display template. In the Search Results web part settings, under Display Templates, select “Custom” and choose a template that includes the managed properties you want. If no custom template exists, the default list view works well. - Save and Publish the Page
Click Stop Editing, then Publish. The page now shows a dynamic list of policy documents from all indexed locations. Users can filter by the refinements you added.
Common Mistakes and Things to Avoid
Search Query Returns No Results
If the search-based view shows no documents, the query syntax is wrong or the content is not indexed. Check the managed property name by going to SharePoint admin center > Search > Managed Properties. Use the exact name. For a site column like “Policy Department”, the managed property is typically “PolicyDepartment” without spaces. Run a test query in the web part settings to confirm results appear.
Refinement Web Part Does Not Filter
The Refinement Web Part must be connected to the Search Results Web Part. If the connection is missing, right-click the Refinement Web Part, select Connections > Send Refinement to > Search Results. Also verify that the refinement property is a managed property with the Refinable attribute set to Yes.
Results Include Draft Documents
By default, search results include only published major versions. If draft policies appear, check that the document library versioning settings are set to require approval for publishing. Drafts are not indexed unless the library setting “Draft item security” is set to “Any user who can read items”.
Page Loads Slowly
A search-based view with many refinements or a very broad query can take time to load. Limit the query scope by adding a site path filter. For example, path:"https://contoso.sharepoint.com/sites/policies". Also reduce the number of refinements to three or four.
Search-Based View vs Standard Library View
| Item | Search-Based View | Standard Library View |
|---|---|---|
| Scope | All indexed sites or a custom result source | Single document library |
| Data freshness | Based on last crawl index (near real-time) | Live, reflects changes immediately |
| Filtering options | Refinement web parts using managed properties | Column filters and grouping |
| Customization | Query syntax, display templates, result sources | Sort, group, filter, and format columns |
| Performance | Depends on search index size and query complexity | Fast for libraries with fewer than 5,000 items |
After you publish the search-based view, test it by searching for a specific policy document. If a document does not appear, check that the document’s metadata matches the query. You can also add a second Search Results Web Part that shows all indexed content to help debug missing policies.
To take this further, create a result source that restricts the search to only policy document libraries. Use the result source in the Search Results Web Part to improve accuracy. For advanced filtering, map additional site columns as managed properties so they become available in the Refinement Web Part.
Finally, consider adding a custom display template that shows policy-specific fields such as effective date, review date, and owner. This gives users a complete view of each policy without opening the document.