Google Cloud Search
Quick Start

Enable APIs

For the connector to work, certain APIs in Google Cloud Search have to be enabled. To do so, execute the following steps:

  1. Login to the Google Cloud Search Console with your admin account

  2. Select your project and click on Library

enable apis select
  1. Search for Cloud Search and click on the result Cloud Search API

enable apis search api
  1. Click on ENABLE

enable apis enable api
  1. Enable Cloud Identity by executing steps 3 and 4 for Cloud Identity

  2. Enable Admin SDK API by executing steps 3 and 4 for Admin SDK

Create Service Account

For the connector to authenticate with Google Cloud Search a Google Cloud Service Account is needed. To create an account, the following steps have to be executed:

  1. Open the menu of the Google Cloud Search Console and select IAM & AdminService accounts

service account open
  1. Press CREATE SERVICE ACCOUNT

service account create
  1. Enter a name and click CREATE AND CONTINUE

service account create2
  1. Skip the optional settings and click DONE

Create and download Service Account Key File

The connector needs a JSON file with the private key of the service account for authentication. This service account file can be generated and downloaded by executing the following steps:

  1. Open the service account details by clicking on the account

service account details
  1. Open the KEYS tab and click on ADD KEYCreate new key

service account create key
  1. Create the service account file by clicking on CREATE and store it under a suitable location

service account create key2

Set up Domain-wide Delegation (if only existing users should be fed)

If only existing users should be fed to Google Cloud Search, domain-wide delegation has to be activated for a service account. To do so execute the following steps:

  1. Make note of the OAuth 2 Client ID of the service account

  2. Login to Google Admin with your admin account and navigate to the API controls and click on MANAGE DOMAIN WIDE DELEGATION

domain wide delegation menu
domain wide delegation manage
  1. Click on Add new

domain wide delegation add new
  1. Enter the service account’s OAuth 2 Client ID in the field Client ID and the scope https://www.googleapis.com/auth/admin.directory.user.readonly in the field OAuth scopes

  2. Click AUTHORIZE

domain wide delegation authorize

Create Data Source

To set up the search first a Datasource in Google Cloud Search has to be created. A Datasource stores searchable content items. To create a Datasource open the Google Cloud Search Admin View:

admin view

Under this Admin View click on Third-party data sources to open the Datasources View:

datasources view

To add a new Datasource click on the + symbol so that the following dialog pops up:

add datasource

Specify a name for the Datasource and set the email address of the service account that has the permissions to write to the Google Cloud Search API.

Create Identity Source

To create an Identity Source open again the Google Cloud Search Admin View and click on Identity sources so that the following view opens:

identitysources view

By clicking on + the following view pops up in which you can add a new Identity Source:

add identitysource

Specify a name for the Identity Source and again set the email address of the service account that has the permissions to write to the Google Cloud Search API. Also set the permissions for the users and groups.

Create Data Source Schema (Optional, recommended)

Google Cloud Search allows us to feed documents into schema-less data source. In order to define facets and the display options in the search result, the data source requires a schema. The out-of-the-box recommended schema definition for the connector is defined as datasource-schema.json inside the folder /schema inside the connector installation. Use the recommended schema file to update the schema of your data source using the Cloud Search API Explorer.

  1. Login with your Cloud Search Account

  2. Specify the ID of your datasource using the format datasources/<your-datasource-id> as the name option in the request parameters.

  3. Paste the content of datasource-schema.json as request body.

  4. Complete the request with the option EXECUTE.

Update Data Source Schema

Setup Search Application

After creating a Datasource and an Identity Source the Search Application can be set up. To do so go to the Google Cloud Search Admin View and click on Search Applications:

admin view2

Then the Search Application View opens:

search applications view

To set up the default Google Cloud Search Application click on the pen to edit it:

search application view

Click on Data sources to see which Datasources are enabled in the Search Application:

search application datasources

Look for the previously created Datasource and enable it for this Search Application.