synonym_sets
Creates, updates, deletes, gets or lists a synonym_sets
resource.
Overview
Name | synonym_sets |
Type | Resource |
Id | google.contentwarehouse.synonym_sets |
Fields
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
Name | Accessible by | Required Params | Description |
---|---|---|---|
get | SELECT | locationsId, projectsId, synonymSetsId | Gets a SynonymSet for a particular context. Throws a NOT_FOUND exception if the Synonymset does not exist |
list | SELECT | locationsId, projectsId | Returns all SynonymSets (for all contexts) for the specified location. |
create | INSERT | locationsId, projectsId | Creates a SynonymSet for a single context. Throws an ALREADY_EXISTS exception if a synonymset already exists for the context. |
delete | DELETE | locationsId, projectsId, synonymSetsId | Deletes a SynonymSet for a given context. Throws a NOT_FOUND exception if the SynonymSet is not found. |
patch | UPDATE | locationsId, projectsId, 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. |
SELECT
examples
Returns all SynonymSets (for all contexts) for the specified location.
SELECT
name,
context,
synonyms
FROM google.contentwarehouse.synonym_sets
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}';
INSERT
example
Use the following StackQL query and manifest file to create a new synonym_sets
resource.
- All Properties
- Manifest
/*+ create */
INSERT INTO google.contentwarehouse.synonym_sets (
locationsId,
projectsId,
synonyms,
context,
name
)
SELECT
'{{ locationsId }}',
'{{ projectsId }}',
'{{ synonyms }}',
'{{ context }}',
'{{ name }}'
;
- name: your_resource_model_name
props:
- name: synonyms
value:
- - name: words
value:
- string
- name: context
value: string
- name: name
value: string
UPDATE
example
Updates a synonym_sets
resource.
/*+ update */
UPDATE google.contentwarehouse.synonym_sets
SET
synonyms = '{{ synonyms }}',
context = '{{ context }}',
name = '{{ name }}'
WHERE
locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND synonymSetsId = '{{ synonymSetsId }}';
DELETE
example
Deletes the specified synonym_sets
resource.
/*+ delete */
DELETE FROM google.contentwarehouse.synonym_sets
WHERE locationsId = '{{ locationsId }}'
AND projectsId = '{{ projectsId }}'
AND synonymSetsId = '{{ synonymSetsId }}';