This page explains how to add filters to your Microsoft SharePoint data stores in Gemini Enterprise. Filters determine which information is retrieved or excluded from the Microsoft SharePoint data store when users chat with the Assistant using the Gemini Enterprise app.
Filter types
You can configure the following filters within the params object of your data connector:
- Inclusion filter (
admin_filter): Retrieves only specific information from the Microsoft SharePoint data store. - Exclusion filter (
admin_exclusion_filter): Excludes specific information from the Microsoft SharePoint data store. - Legacy filter (
structured_search_filter): Previously used to create a data store with filters using the API.
Filter keys
The filter parameters accept an object containing key-value pairs. The keys represent the SharePoint fields you want to filter on, and the values are arrays of strings containing the criteria to match. When updating filters using the API, the following keys are supported:
| Filter name | FILTER_KEY |
Description | URL examples |
|---|---|---|---|
| Site | Site |
Filters search results based on the Microsoft SharePoint site URLs. | https://{your-tenant}.sharepoint.com/sites/{your-site-name} |
| Path | Path |
Filters search results based on specific URL prefixes. Use this for granular control to include or exclude sensitive sub-folders. The paths can point to any site, subsite, folder, or file. | https://{your-tenant}.sharepoint.com/sites/{your-site-name}/Documents3/ |
Filter combinations
The following table details how different combinations of inclusion and exclusion filters behave:
| Filter combination | Behavior |
|---|---|
| Path (Inclusion) + Site (Empty) | Operates as a Path inclusion filter only. |
| Site (Inclusion) + Path (Empty) | Operates as a Site inclusion filter only. |
| Site (Inclusion) + Path (Exclusion) | Includes a broad site while excluding specific granular paths or sensitive folders within it. |
| Path (Inclusion) + Site (Inclusion) | Includes the intersection of both filters. A path is only included if both the path and its parent site are specified. We recommend using a single inclusion filter (Site or Path) to prevent configuration errors due to an empty intersection. |
| Site (Exclusion) + Path (Exclusion) | Excludes any path matching either exclusion filter from the data store. |
Update filters in an existing data store
You can update filters in an existing data store using either the Google Cloud console or the API.
Console
To modify existing filter configurations:- In the Google Cloud console navigation menu, click Data stores.
- Select your Microsoft SharePoint data store.
- Click View/edit parameters.
- In the View/edit parameters panel, add or update the Microsoft SharePoint URLs and filter types.
- Click Save.
REST
To add or to update filters in an existing
Microsoft SharePoint data store, call the
updateDataConnector
method with any one of these fields:
- The
admin_filterfield for inclusion filter. - The
admin_exclusion_filterfield for exclusion filter. - The legacy
structured_search_filterfield.
In the request body, the field must contain all the filters you want to have in the data store, including the filters that are not updated.
To add or update filters in an existing SharePoint data store, run the following command:
curl -X PATCH
-H "Authorization: Bearer $(gcloud auth print-access-token)"
-H "Content-Type: application/json"
-H "X-Goog-User-Project: PROJECT_ID"
"https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/LOCATION/collections/COLLECTION_ID/dataConnector?updateMask=params"
-d '{ "params": { "FILTER_TYPE": { "FILTER_KEY": [ "UPDATED_FILTER_VALUE1", "UPDATED_FILTER_VALUE2" ] } } }'
Replace the following:
-
PROJECT_ID: the ID of your project. -
ENDPOINT_LOCATION: the multi-region for your API request. Specify one of the following values:usfor the US multi-regioneufor the EU multi-regionglobalfor the Global location
-
LOCATION: the multi-region of your data store:global,us, oreu -
COLLECTION_ID: The ID of the collection containing the data store. -
FILTER_TYPE: the type of filter added to your Microsoft SharePoint data stores. For more information, see Filter types. -
FILTER_KEY: the key for the filter, corresponding to a field in your data. For more information, see Filter keys. -
UPDATED_FILTER_VALUES: the value or values to filter on for the specifiedUPDATED_FILTER_KEY.
Important Considerations
If you switch from an inclusion filter to an exclusion filter, or from an exclusion filter to an inclusion filter, you must explicitly remove the filter that is no longer required by setting it to empty in the request body. For example, if you have an
admin_filterand want to switch toadmin_exclusion_filter, include"admin_filter": {}in addition toadmin_exclusion_filterin your API requestparamsobject. The following example showsparamsobject when switching fromadmin_filtertoadmin_exclusion_filter:"params": { "admin_filter": {}, "admin_exclusion_filter": { "Site": ["https://tenant1.sharepoint.com/sites/hr-portal-site"] } }
When updating filters, you must include the previously added filters as well. For example, if you have previously added a Site filter and want to update or add a Path filter, use the following command:
"params": { "admin_filter": { "Site": ["https://tenant1.sharepoint.com/sites/hr-portal-site"], "Path": ["https://tenant1.sharepoint.com/sites/site-name1/Documents2"] } }
Verify that the data store includes the filters
You can get the details of the data store to confirm that the filters you added or updated are correctly applied using the Google Cloud console or the API:
Console
To view the existing filter configurations:- In the Google Cloud console > navigation menu, click Data stores.
- Select your Microsoft SharePoint data store.
- Click View/edit parameters.
In the View/edit parameters panel, the existing filters applied to the data store are displayed.
REST
To verify data store settings, call the
dataConnector.get
method:
curl -X GET \ -H "Authorization: Bearer $(gcloud auth print-access-token)" \ -H "X-Goog-User-Project: PROJECT_ID" \ "https://ENDPOINT_LOCATION-discoveryengine.googleapis.com/v1alpha/projects/PROJECT_ID/locations/LOCATION/collections/COLLECTION_ID/dataConnector"
Replace the following:
-
PROJECT_ID: the ID of your project. -
ENDPOINT_LOCATION: the multi-region for your API request. Specify one of the following values:usfor the US multi-regioneufor the EU multi-regionglobalfor the Global location
-
LOCATION: the multi-region of your data store:global,us, oreu -
COLLECTION_ID: the ID of the collection containing the data store.
In the response, view the admin_filter, admin_exclusion_filter, or structured_search_filter fields in params to verify
the filters.
What's next
- To provide a user interface for querying your Microsoft SharePoint data, create an app and connect it to the Microsoft SharePoint data store.
- To manage the list of actions, see Manage actions.
- To preview how your search results appear after your app is set up, see Get search results.
- To enable alerts for the data store, see Configure alerts for third-party data stores.