How to Exclude Root SharePoint Libraries from Azure Cognitive Search
Question details
The user needs to index multiple SharePoint subsites and their custom columns in Azure Cognitive Search while explicitly preventing libraries in the root SharePoint site from being indexed.

- Product
- Azure Cognitive Search
- Device & OS
- not provided
- Scenario
- Configuring indexer data source queries to selectively index subsite data while excluding root-level data.
- Observed behavior
- The excludeLibrary property used in the data source query is not functioning as expected, and root site libraries are still being processed or causing configuration issues.
Ensure you have administrative access to your Azure Cognitive Search resource and the target SharePoint sites. Verify the specific Azure Cognitive Search API version you are using, as query property support may vary between preview and stable releases.
Scope Separate Data Sources to Individual Subsites
If the exclusion property fails at the root level, bypass the root site entirely by scoping data sources and indexers directly to the required subsites.
Instead of targeting the root site and attempting to filter out its libraries, building targeted indexers for each required subsite is often a more reliable design pattern in Azure Cognitive Search.
Log into the Azure Portal and navigate to your Azure Cognitive Search service.
Instead of creating a single data source at the SharePoint root level, create individual data sources scoped precisely to the specific SharePoint subsite URLs.
Set up indexers for each of the new subsite data sources. Ensure you accurately map the internal names of your SharePoint custom columns to the corresponding fields in your Azure index schema.
Run the indexers. Verify that the search index now only contains documents from the subsites, inherently excluding all root site libraries by design.

Consult Microsoft Q&A for API-Specific Guidance
Since this involves specific API behaviors for Azure AI Services, reaching out to Microsoft specialists can help resolve undocumented property issues.
Simplify Your Document Management with WPS Office
Dealing with complex SharePoint indexers and cloud data sources can be tedious for standard document management. If you are looking for an intuitive, lightweight, and completely free Microsoft Office alternative for creating and organizing your files, WPS Office is an excellent choice. Enjoy a familiar interface and seamless migration without the hassle.
- 1. Download and Install: Get the free WPS Office installer from the official website and install it on your device.
- 2. Sign In: Launch the application and sign in to activate your free account for cloud access.
- 3. Edit Seamlessly: Open, edit, and save your existing Microsoft Office files without worrying about formatting issues.

Frequently Asked Questions
Why isn't the excludeLibrary property working for my SharePoint root site?
This issue typically occurs if the specific Azure Cognitive Search API version in use does not fully support root-level library exclusions in a single query, or if the library path is improperly formatted in the JSON payload.
Can I index custom SharePoint columns in Azure Cognitive Search?
Yes, Azure Cognitive Search can index custom columns from SharePoint. You must ensure that the field mappings in your indexer explicitly reference the correct internal names of the custom SharePoint columns.
Is there a limit to how many SharePoint subsites I can index individually?
While Azure Cognitive Search supports utilizing multiple data sources and indexers, your specific limits depend entirely on the pricing tier (e.g., Basic, Standard) of your Azure Search service.




