Skip to main content

synonym_sets

Creates, updates, deletes, gets or lists a synonym_sets resource.

Overview​

Namesynonym_sets
TypeResource
Idgoogle.contentwarehouse.synonym_sets

Fields​

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe resource name of the SynonymSet This is mandatory for google.api.resource. Format: projects/{project_number}/locations/{location}/synonymSets/{context}.
contextstringThis is a freeform field. Example contexts can be "sales," "engineering," "real estate," "accounting," etc. The context can be supplied during search requests.
synonymsarrayList of Synonyms for the context.

Methods​

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, synonymSetsIdGets a SynonymSet for a particular context. Throws a NOT_FOUND exception if the Synonymset does not exist
listselectprojectsId, locationsIdpageSize, pageTokenReturns all SynonymSets (for all contexts) for the specified location.
createinsertprojectsId, locationsIdCreates a SynonymSet for a single context. Throws an ALREADY_EXISTS exception if a synonymset already exists for the context.
patchupdateprojectsId, locationsId, synonymSetsIdRemove the existing SynonymSet for the context and replaces it with a new one. Throws a NOT_FOUND exception if the SynonymSet is not found.
deletedeleteprojectsId, locationsId, synonymSetsIdDeletes 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.

NameDatatypeDescription
locationsIdstring
projectsIdstring
synonymSetsIdstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples​

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
;

INSERT examples​

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__name,
data__synonyms,
projectsId,
locationsId
)
SELECT
'{{ context }}',
'{{ name }}',
'{{ synonyms }}',
'{{ projectsId }}',
'{{ locationsId }}'
RETURNING
name,
context,
synonyms
;

UPDATE examples​

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__name = '{{ name }}',
data__synonyms = '{{ synonyms }}'
WHERE
projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND synonymSetsId = '{{ synonymSetsId }}' --required
RETURNING
name,
context,
synonyms;

DELETE examples​

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
;