Others

How to Exclude Root SharePoint Libraries from Azure Cognitive Search

Tauseeq MagsiTauseeq Magsi Oct 14, 2026 868 views

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.

Exclude Root SharePoint Libraries from Azure Cognitive Search Indexing
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.
Before you start

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.

Solution 1Recommended

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.

1
Access Azure Portal

Log into the Azure Portal and navigate to your Azure Cognitive Search service.

2
Create Subsite Data Sources

Instead of creating a single data source at the SharePoint root level, create individual data sources scoped precisely to the specific SharePoint subsite URLs.

3
Configure Indexers and Field Mappings

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.

4
Run and Verify

Run the indexers. Verify that the search index now only contains documents from the subsites, inherently excluding all root site libraries by design.

Scope Separate Data Sources to Individual Subsites
Indexing Strategy: Using separate data sources provides finer control over permissions and indexing schedules for each subsite.
Free Microsoft Office alternative

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. 1. Download and Install: Get the free WPS Office installer from the official website and install it on your device.
  2. 2. Sign In: Launch the application and sign in to activate your free account for cloud access.
  3. 3. Edit Seamlessly: Open, edit, and save your existing Microsoft Office files without worrying about formatting issues.
Manage and organize your documents easily locally or in the cloud without configuring complex Azure indexers.Fully compatible with Microsoft Office file formats like .docx, .xlsx, and .pptx.Lightweight installation with a highly familiar user interface for zero learning curve.
microsoft office alternative - wps office

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.