Query

A query definition relevant for search & export.

JSON representation
{
  "corpus": enum(CorpusType),
  "dataScope": enum(DataScope),
  "searchMethod": enum(SearchMethod),
  "terms": string,
  "startTime": string,
  "endTime": string,
  "timeZone": string,

  // Union field search_method_field can be only one of the following:
  "accountInfo": {
    object(AccountInfo)
  },
  "orgUnitInfo": {
    object(OrgUnitInfo)
  },
  "teamDriveInfo": {
    object(TeamDriveInfo)
  },
  "hangoutsChatInfo": {
    object(HangoutsChatInfo)
  }
  // End of list of possible types for union field search_method_field.

  // Union field corpus_options_field can be only one of the following:
  "mailOptions": {
    object(MailOptions)
  },
  "driveOptions": {
    object(DriveOptions)
  },
  "hangoutsChatOptions": {
    object(HangoutsChatOptions)
  }
  // End of list of possible types for union field corpus_options_field.
}
Fields
corpus

enum(CorpusType)

The corpus to search.

dataScope

enum(DataScope)

The data source to search from.

searchMethod

enum(SearchMethod)

The search method to use.

terms

string

The corpus-specific search operators used to generate search results.

startTime

string (Timestamp format)

The start time range for the search query. These timestamps are in GMT and rounded down to the start of the given date.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

endTime

string (Timestamp format)

The end time range for the search query. These timestamps are in GMT and rounded down to the start of the given date.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

timeZone

string

The time zone name. It should be an IANA TZ name, such as "America/Los_Angeles". For more information, see Time Zone.

Union field search_method_field. The detailed information correlated to each search method search_method_field can be only one of the following:
accountInfo

object(AccountInfo)

When 'ACCOUNT' is chosen as search method, accountInfo needs to be specified.

orgUnitInfo

object(OrgUnitInfo)

When 'ORG_UNIT' is chosen as as search method, orgUnitInfo needs to be specified.

teamDriveInfo

object(TeamDriveInfo)

When 'TEAM_DRIVE' is chosen as search method, teamDriveInfo needs to be specified.

hangoutsChatInfo

object(HangoutsChatInfo)

When 'ROOM' is chosen as search method, hangout_chats_info needs to be specified. (read-only)

Union field corpus_options_field. Advanced options correlated to each corpus. corpus_options_field can be only one of the following:
mailOptions

object(MailOptions)

For mail search, specify more options in this field.

driveOptions

object(DriveOptions)

For Drive search, specify more options in this field.

hangoutsChatOptions

object(HangoutsChatOptions)

For hangouts chat search, specify more options in this field. (read-only)

DataScope

The supported data scope to search from.

Enums
DATA_SCOPE_UNSPECIFIED No data scope specified.
ALL_DATA All available data.
HELD_DATA Data on hold.
UNPROCESSED_DATA Data not processed.

SearchMethod

The supported search method.

Enums
SEARCH_METHOD_UNSPECIFIED A search method must be specified. If a request does not specify a search method, it will be rejected.
ACCOUNT Will search all accounts provided in accountInfo.
ORG_UNIT Will search all accounts in the OU specified in orgUnitInfo.
TEAM_DRIVE Will search for all accounts in the Team Drive specified in teamDriveInfo.
ENTIRE_ORG Will search for all accounts in the organization. No need to set accountInfo or orgUnitInfo.
ROOM Will search in the Room specified in hangout_chats_info. (read-only)

AccountInfo

Accounts to search

JSON representation
{
  "emails": [
    string
  ]
}
Fields
emails[]

string

A set of accounts to search.

OrgUnitInfo

Org Unit to search

JSON representation
{
  "orgUnitId": string
}
Fields
orgUnitId

string

Org unit to search, as provided by the Admin SDK Directory API.

TeamDriveInfo

Team Drives to search

JSON representation
{
  "teamDriveIds": [
    string
  ]
}
Fields
teamDriveIds[]

string

List of Team Drive ids, as provided by Drive API.

HangoutsChatInfo

Accounts to search

JSON representation
{
  "roomId": [
    string
  ]
}
Fields
roomId[]

string

A set of rooms to search.

MailOptions

Mail search advanced options

JSON representation
{
  "excludeDrafts": boolean
}
Fields
excludeDrafts

boolean

Set to true to exclude drafts.

DriveOptions

Drive search advanced options

JSON representation
{
  "versionDate": string,
  "includeTeamDrives": boolean
}
Fields
versionDate

string (Timestamp format)

Search the versions of the Drive file as of the reference date. These timestamps are in GMT and rounded down to the given date.

A timestamp in RFC3339 UTC "Zulu" format, accurate to nanoseconds. Example: "2014-10-02T15:01:23.045123456Z".

includeTeamDrives

boolean

Set to true to include Team Drive.

HangoutsChatOptions

Hangouts chat search advanced options

JSON representation
{
  "includeRooms": boolean
}
Fields
includeRooms

boolean

Set to true to include rooms.