SharePoint Document Issues

How to Fix SharePoint Online Search Vertical KQL Queries for Multiple Sites

Elise WilliamsElise Williams Oct 26, 2026 869 views

Question details

The user needs to configure a SharePoint Online search vertical using a KQL query to return results from multiple specific site URLs.

How to Fix SharePoint Online Search Vertical KQL Queries for Multiple Sites
Product
SharePoint Online
Device & OS
not provided
Scenario
Setting up a custom search vertical in SharePoint to fetch and display documents across multiple site collections.
Observed behavior
The search vertical only returns results from one site, completely ignoring the second site in the OR clause of the KQL query.
Before you start

Ensure you have the necessary site collection administrator permissions for all the SharePoint sites you are trying to include in your search vertical, and verify that both target sites are set to allow search indexing.

Solution 1Recommended

Verify and Correct the KQL Path Query Syntax

Fix syntax grouping issues in your KQL query to ensure the search engine evaluates both site paths correctly before applying the search terms.

When querying multiple paths in SharePoint using KQL (Keyword Query Language), failing to enclose the OR conditions in parentheses causes the query parser to evaluate the logic incorrectly. This typically results in the search engine matching only the first path constraint.

1
Access Search Settings

Navigate to your SharePoint site settings, go to Microsoft Search, and click on 'Search Verticals' or edit your specific search web part configuration pane.

2
Edit the Query Template

Locate the query template text box where your custom KQL query is defined.

3
Group Path Restrictions

Update your query to explicitly group the Path restrictions using parentheses. Change it to format: {searchTerms} (Path:https://mydomain.sharepoint.com/sites/site1 OR Path:https://mydomain.sharepoint.com/sites/site2).

4
Save and Allow Indexing

Save the search vertical configuration. It may take some time for the changes to propagate across the tenant and for the search index to reflect the new scope.

Verify and Correct the KQL Path Query Syntax
Check User Permissions: SharePoint search results are security-trimmed. Ensure the account performing the search has read access to both sites. If access is missing for one site, those results will be hidden regardless of query syntax.
Free Microsoft Office alternative

Manage Your Office Documents Seamlessly with WPS Office

While managing SharePoint search verticals requires complex KQL queries and administration, WPS Office offers a lightweight, hassle-free alternative for creating, editing, and managing your daily documents. Enjoy an intuitive experience and high compatibility with Microsoft Word, Excel, and PowerPoint without the heavy administrative overhead.

  1. 1. Download WPS Office: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Install the Software: Run the installer and follow the simple on-screen instructions to complete the setup.
  3. 3. Open Microsoft Formats: Launch WPS Office and directly open your existing Word, Excel, or PowerPoint files with full format preservation.
Highly compatible with Microsoft Office formats (.docx, .xlsx, .pptx).Free and lightweight suite for comprehensive document management.Intuitive interface that requires zero learning curve for seamless migration.Built-in PDF editing tools for easy daily workflow execution.
microsoft office alternative - wps office

Frequently Asked Questions

Why does my KQL query only return results from one site?

This typically occurs due to incorrect grouping in the query syntax (such as missing parentheses around the OR conditions), or the user lacking adequate read permissions on the second site. Search results in SharePoint are automatically security-trimmed.

How do I force SharePoint to reindex a site collection?

Navigate to the target site, click the Gear icon > Site information > View all site settings. Under the Search section, click 'Search and offline availability', scroll down, and click the 'Reindex site' button. This tells the search crawler to re-evaluate the site contents.

Can I use wildcard characters in SharePoint KQL Path queries?

Yes, you can use the asterisk (*) as a wildcard in KQL queries. For example, 'Path:https://domain.sharepoint.com/sites/hr/*' will return all items located within that specific site collection or folder path.

How long does it take for search vertical changes to apply?

Changes to custom search verticals and newly indexed items can take anywhere from a few minutes to several hours to fully propagate and reflect accurately in the SharePoint Online search results.