synonym_sets
Creates, updates, deletes, gets or lists a synonym_sets
resource.
Overview
Name | synonym_sets |
Type | Resource |
Id | google.contentwarehouse.synonym_sets |
Fields
The following fields are returned by SELECT
queries:
- get
- list
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The resource name of the SynonymSet This is mandatory for google.api.resource. Format: projects/{project_number}/locations/{location}/synonymSets/{context}. |
context | string | This is a freeform field. Example contexts can be "sales," "engineering," "real estate," "accounting," etc. The context can be supplied during search requests. |
synonyms | array | List of Synonyms for the context. |
Successful response
Name | Datatype | Description |
---|---|---|
name | string | The resource name of the SynonymSet This is mandatory for google.api.resource. Format: projects/{project_number}/locations/{location}/synonymSets/{context}. |
context | string | This is a freeform field. Example contexts can be "sales," "engineering," "real estate," "accounting," etc. The context can be supplied during search requests. |
synonyms | array | List of Synonyms for the context. |
Methods
The following methods are available for this resource:
Name | Accessible by | Required Params | Optional Params | Description |
---|---|---|---|---|
get | select | projectsId , locationsId , synonymSetsId | Gets a SynonymSet for a particular context. Throws a NOT_FOUND exception if the Synonymset does not exist | |
list | select | projectsId , locationsId | pageSize , pageToken | Returns all SynonymSets (for all contexts) for the specified location. |
create | insert | projectsId , locationsId | Creates a SynonymSet for a single context. Throws an ALREADY_EXISTS exception if a synonymset already exists for the context. | |
patch | update | projectsId , locationsId , synonymSetsId | Remove the existing SynonymSet for the context and replaces it with a new one. Throws a NOT_FOUND exception if the SynonymSet is not found. | |
delete | delete | projectsId , locationsId , synonymSetsId | Deletes a SynonymSet for a given context. Throws a NOT_FOUND exception if the SynonymSet is not found. |
Parameters
Parameters can be passed in the WHERE
clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
Name | Datatype | Description |
---|---|---|
locationsId | string | |
projectsId | string | |
synonymSetsId | string | |
pageSize | integer (int32) | |
pageToken | string |
SELECT
examples
- get
- list
Gets a SynonymSet for a particular context. Throws a NOT_FOUND exception if the Synonymset does not exist
SELECT
name,
context,
synonyms
FROM google.contentwarehouse.synonym_sets
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND synonymSetsId = '{{ synonymSetsId }}' -- required;
Returns all SynonymSets (for all contexts) for the specified location.
SELECT
name,
context,
synonyms
FROM google.contentwarehouse.synonym_sets
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND pageSize = '{{ pageSize }}'
AND pageToken = '{{ pageToken }}';
INSERT
examples
- create
- Manifest
Creates a SynonymSet for a single context. Throws an ALREADY_EXISTS exception if a synonymset already exists for the context.
INSERT INTO google.contentwarehouse.synonym_sets (
data__context,
data__synonyms,
data__name,
projectsId,
locationsId
)
SELECT
'{{ context }}',
'{{ synonyms }}',
'{{ name }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
context,
synonyms
;
# Description fields are for documentation purposes
- name: synonym_sets
props:
- name: projectsId
value: string
description: Required parameter for the synonym_sets resource.
- name: locationsId
value: string
description: Required parameter for the synonym_sets resource.
- name: context
value: string
description: >
This is a freeform field. Example contexts can be "sales," "engineering," "real estate," "accounting," etc. The context can be supplied during search requests.
- name: synonyms
value: array
description: >
List of Synonyms for the context.
- name: name
value: string
description: >
The resource name of the SynonymSet This is mandatory for google.api.resource. Format: projects/{project_number}/locations/{location}/synonymSets/{context}.
UPDATE
examples
- patch
Remove the existing SynonymSet for the context and replaces it with a new one. Throws a NOT_FOUND exception if the SynonymSet is not found.
UPDATE google.contentwarehouse.synonym_sets
SET
data__context = '{{ context }}',
data__synonyms = '{{ synonyms }}',
data__name = '{{ name }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND synonymSetsId = '{{ synonymSetsId }}' --required
RETURNING
name,
context,
synonyms;
DELETE
examples
- delete
Deletes a SynonymSet for a given context. Throws a NOT_FOUND exception if the SynonymSet is not found.
DELETE FROM google.contentwarehouse.synonym_sets
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND synonymSetsId = '{{ synonymSetsId }}' --required;