Add or Edit a Google Drive for Work Source

You can add the content of your domain’s Google Drives to a Coveo organization by creating a Google Drive for Work source.

Depending on your source configuration, the source indexes the content of the My Drive folder for either all or specific users on your domain. You can also configure the source to index content in users’ Shared Drives.

You can use the Content Security tab to select whether the source content is accessible to everyone, or as determined by your source permissions system.

A Google account with administrator credentials is required when creating the source. The credentials authorize the Coveo organization to read your Google account using OAuth 2.0, a protocol that authorizes access without giving your password.

To index content in your users’ Google Drives:

  1. Authorize your Coveo organization to access your users’ Google Drives.

  2. Create your Google Drive for Work source.

  3. Index the content of your users’ Shared Drives (optional).

Source Key Characteristics

Features Supported Additional information
Google Drive for Work version Latest cloud version Following available Google Drive for Work releases
Searchable content types1 Files, folders, comments and replies2, and user profiles
Content update operations Refresh Takes place every day by default.
Rescan  
Rebuild  
Content security options Determined by source permissions  
Source creator  
Everyone  

1: By default, the Google Drive for Work source indexes files of the My Drive folder for each user, but you can configure the source to index files only for specific users. You can also choose to index files in users’ Shared Drives. Shared items are indexed with the associated permissions, so that whoever is authorized to see the items can find them in Coveo search results.

2: The comments and replies are indexed in the coveo.comments and coveo.comments.authors metadata of their parent item rather than as separate items. This way, users can search for the content of a comment or reply and find the parent item.

Authorize Your Coveo Organization to Access the Google Drive of Your Users

Before you create a Google Drive for Work source, you must:

  1. Create a Google API Console project.

  2. Modify security parameters in your Google Apps account.

Add or Edit a Google Drive for Work Source

Once you’ve authorized your Coveo organization to access your users’ Google Drive, follow the instructions below to add or edit your Google Drive for Work source.

“Configuration” Tab

In the Add/Edit a Google Drive for Work Source panel, the Configuration tab is selected by default. It contains your source’s general and authentication information, as well as other parameters.

General Information

Source Name

Enter a name for your source.

A source name can’t be modified once it’s saved, therefore be sure to use a short and descriptive name, using letters, numbers, hyphens (-), and underscores (_). Avoid spaces and other special characters.

Google Apps Domain

Enter the Google Drive domain that you want to index.

Google Apps Administrator Account Email

Enter the email of a Google Apps administrator account in the user@company.com format.

Google Service Account Email

Enter the Google service account email address that you obtained when you authorized your Coveo organization to access the Google Drive of your users.

Private Key File

Click Choose File, and then select the private key file that you created when you authorized your Coveo organization to access the Gmail mailboxes of your users.

Character Optical Recognition (OCR)

If you want Coveo Cloud to extract text from image files or PDF files containing images, check the appropriate box. OCR-extracted text is processed as item data, meaning that it’s fully searchable and will appear in the item Quick View. See Enable Optical Character Recognition for details on this feature.

Index

When adding a source, if you have more than one logical (non-Elasticsearch) index in your organization, select the index in which the retrieved content will be stored (see Leverage Many Coveo Indexes). If your organization only has one index, this drop-down menu isn’t visible and you have no decision to make.

  • To add a source storing content in an index different than default, you need the View access level on the Logical Index domain (see Manage Privileges and Logical Indexes Domain).

  • Once the source is added, you can’t switch to a different index.

“Users to Include” Section

Select All (default) to index the Google Drive content of all your domain users. Alternatively, select Specific to index the content of specific users only, and then enter the corresponding user email addresses.

By default, your Google Drive for Work source indexes files in a user’s My Drive folder, but you can choose to index content in users’ Shared Drives as well.

If you want users to be indexed as separate items, you must add the IndexUsers hidden parameter to the parameters section of the source JSON configuration, and then set its value to true.

“Additional Content to Include” Section

Trashed Items

Check this box to index the items in the trash folder.

Custom Properties

Check this box to include custom properties that Google applications or your custom applications added on items.

Including custom properties significantly increases communication traffic between the source and the Google Drive. This, in turn, significantly increases indexing time.

“Content Security” Tab

Select who will be able to access the source items through a Coveo-powered search interface. For details on this parameter, see Content Security.

The Source Creator security option is not available for a Google Drive for Work source.

If your source uses the Determined by source permissions Content Security option, see the Link Sharing and the “Determined by Source Permissions” Content Security Option section for information on how a Google Drive file’s link-sharing options affect who can access the corresponding file in a Coveo-powered search interface.

“Access” Tab

In the Access tab, determine whether each group and API key can view or edit the source configuration (see Resource Access):

  1. In the Access Level column, select View or Edit for each available group.

  2. On the left-hand side of the tab, if available, click Groups or API Keys to switch lists.

Completion

  1. Finish adding or editing your source:

    • When you want to save your source configuration changes without starting a build/rebuild, such as when you know you want to do other changes soon, click Add Source/Save.

      To add the source content or to make your changes effective, on the Sources page, you must click Launch build or Start required rebuild in the source Status column.

      OR

    • When you’re done editing the source and want to make changes effective, click Add and Build Source/Save and Rebuild Source.

      Back on the Sources page, you can review the progress of your source addition or modification.

    Once the source is built or rebuilt, you can review its content in the Content Browser.

  2. Optionally, consider editing or adding mappings.

    You can only manage mapping rules once you build the source (see Refresh, Rescan, or Rebuild Sources).

Index Content of Shared Drives

By default, a Google Drive for Work source indexes the content of the My Drive folder for either all or specific users on your domain, depending on the source Content Security configuration. However, you can configure the source to index content from users’ Shared Drives as well by doing the following:

  1. On the Sources page, click the Google Drive for Work source.

  2. In the Action bar, click More, and then select Edit JSON.

  3. In the Edit a Source JSON Configuration panel, set the IndexSharedDrives parameter value to true.

If your source uses the Determined by source permissions Content Security option, see the Link Sharing and the “Determined by Source Permissions” Content Security Option section for information on how a Google Drive file’s link-sharing options affect who can access the corresponding file in a Coveo-powered search interface.

Your Google Drive for Work source indexes content only from Shared Drives that are associated to an authenticated user who is set as the Shared Drive’s manager.

If your source has the Determined by source permissions Content Security option enabled, a user sees a Google Drive file in their Coveo search results only if the user is authorized to access the file based on the file’s link-sharing setting in Google Drive. In other words, if the file is shared with the user in Google Drive, the user will see the file in their Coveo search results.

Depending on a Google Drive file’s link-sharing settings, access is either:

  • Restricted to specific users only.

  • Granted to everyone in the organization account or everyone in general.

When you set the link-sharing options for a folder in Google Drive, all files in the folder automatically inherit the folder’s link-sharing settings. This means that if you set the link-sharing options for a specific file, and then set the options for the file’s folder, the file’s link-sharing settings change to match its folder settings.

Restrict Access to Searchable Content Only

If the link-sharing options for a Google Drive file is set to allow access to everyone in your organization, you can use the OnlyIndexFilesSharedToDomainandSearchable source parameter in conjunction with the People in [organization] can search for this file link setting in Google Drive to index the file only if it is set as searchable in Google Drive. You can use this parameter, for instance, if you want to exclude a file from Coveo search results but make the file accessible in Google Drive.

By default, the OnlyIndexFilesSharedToDomainandSearchable parameter value is set to False, which means that all shared files are indexed and appear in Coveo search results for everyone in your organization. To restrict file access in Coveo search results only to files that are set as searchable in Google Drive:

  1. In Google Drive, do the following for each file that you want your organization members to see in Coveo search results:

    1. Right-click the file, and then click Get link.

    2. In the Get Link section, click the Link Settings icon.

    3. Enable People in [organization] can search for this file.

  2. On the Sources page, click the Google Drive for Work source.

  3. In the Action bar, click More, and then select Edit JSON.

  4. In the Edit a Source JSON Configuration panel, set the OnlyIndexFilesSharedToDomainandSearchable parameter value to true.

  5. Click Save or Save and Rebuild.

What’s Next?

Adapt the source update schedule to your needs.

Recommended Articles