How to Fix SharePoint Online Search Vertical KQL Queries for Multiple Sites
Question details
The user needs to configure a SharePoint Online search vertical using a KQL query to return results from multiple specific site URLs.

- 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.
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.
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.
Navigate to your SharePoint site settings, go to Microsoft Search, and click on 'Search Verticals' or edit your specific search web part configuration pane.
Locate the query template text box where your custom KQL query is defined.
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).
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.

Check Site Search Visibility and Reindex Status
Verify that the missing site is actually configured to appear in search results and trigger a manual reindex to update the search crawler.
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. Download WPS Office: Visit the official WPS Office website and download the free installation package for your operating system.
- 2. Install the Software: Run the installer and follow the simple on-screen instructions to complete the setup.
- 3. Open Microsoft Formats: Launch WPS Office and directly open your existing Word, Excel, or PowerPoint files with full format preservation.

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.




