To exclude libraries from the "Root" site or exclude the entire "Root" site so that only the libraries from its subsites are indexed, you can use the excludeLibrary
parameter in the query
property of the container
section in the datasource definition. However, based on the provided JSON, the excludeLibrary
parameter is not being used correctly. The excludeLibrary
parameter should be used as a separate query parameter and not concatenated with the includeLibrariesInSite
parameter. Here's an example of how to exclude a library from the "Root" site:
{
"name": "prod-sharepoint-datasource",
"type": "sharepoint",
"credentials": {
"connectionString": "SharePointOnlineEndpoint=https://xxx.sharepoint.com/sites/Root/;ApplicationId=xxx;ApplicationSecret=xxx"
},
"container": {
"name": "useQuery",
"query": "includeLibrariesInSite=https://xxx.sharepoint.com/sites/Root/subsite-1;additionalColumns=MyCustomColumn,MyCustomColumn2,MyCustomColumn3&excludeLibrary=https://xxx.sharepoint.com/sites/Root/Library1.aspx"
}
}
In the example above, the excludeLibrary
parameter is added as a separate query parameter using the &
symbol to separate it from the includeLibrariesInSite
parameter. This will exclude the "Library1" library from the "Root" site.
To exclude the entire "Root" site so that only the libraries from its subsites are indexed, you can use the includeLibrariesInSite
parameter to specify the subsites to include and exclude the "Root" site. Here's an example:
{
"name": "prod-sharepoint-datasource",
"type": "sharepoint",
"credentials": {
"connectionString": "SharePointOnlineEndpoint=https://xxx.sharepoint.com/sites/Root/;ApplicationId=xxx;ApplicationSecret=xxx"
},
"container": {
"name": "useQuery",
"query": "includeLibrariesInSite=https://xxx.sharepoint.com/sites/Root/subsite-1,https://xxx.sharepoint.com/sites/Root/subsite-2;additionalColumns=MyCustomColumn,MyCustomColumn2,MyCustomColumn3"
}
}
In the example above, the includeLibrariesInSite
parameter is used to specify the subsites to include, and the "Root" site is excluded. This will only index the libraries from the "subsite-1" and "subsite-2" subsites.
References: