Skip to content
Search! & Match! API
Save Synonyms Service
latest

Save Synonyms Service

Save Synonyms Service🔗

The save synonyms service allows to manage custom (user-added) synonyms and remember synonym selections. It comes with methods to save and delete them. All method are existing in two variants: one including user authentication, and another one requesting a valid access token.

All methods of this service can raise the following common errors. Method-specific errors are mentioned later. While the methods with user authentication can raise an INVALID_PASSWORD error, the versions requiring access tokens can instead return INVALID_ACCESS_TOKEN errors.

Common Error Handling🔗

Error Code Description
EMPTY_ARGUMENT One or more mandatory arguments are empty.
METHOD_NOT_AVAILABLE The requested method is not enabled in the environment configuration.
INVALID_PASSWORD The password is incorrect - applies only to password authentication.
INVALID_ACCESS_TOKEN The token is not valid (possibly timed-out) - applies only to token authentication.
ENVIRONMENT_NOT_AVAILABLE The environment is not available (see log-file for possible errors).
DATABASE_ERROR Database communication failed (possibly a misconfiguration issue).

Method saveSynonyms🔗

Method call🔗

saveSynonyms(environment, password, user, field, term, customSynonyms, selectedSynonyms) : saveSynonymsResponse

Description🔗

The save synonym service saves the custom synonyms to the user-field-term combination (in other words, the synonyms are added to terms which are user and field specific). The two parameters are customSynonyms for user's custom synonyms, and selectedSynonyms for the user's remembered synonym selections, which spans both custom synonyms and configured synonyms. Either may be empty. In any case the lists override the previously associated values of customSynonyms and selectedSynonyms. This method can be called as:

Parameters🔗

Parameter Name Type Description
environment string the name of a search environment
password string the password for the search environment
user string the identifier for the user
field string name of the search field
term string the keyword or phrase having synonyms
customSynonyms List of strings the list of custom synonyms added by the user
selectedSynonyms List of strings the list of synonyms selected by the user (spans both custom and configured synonyms)

Returns🔗

Result Name Type Description
saveSynonymResponse String OK on success

Pre-Condition🔗

  • Saving custom synonyms must be enabled for the given environment to save non-empty customSynonyms.
  • Remembering selected synonyms must be enabled for the given environment to save non-empty selectedSynonyms.

Post-Condition🔗

The custom synonyms and selections have been persisted to the configured database.

Error Handling🔗

See the description of common errors above.

Method saveSynonymsWithToken🔗

Method call🔗

saveSynonymsWithToken(accessToken, field, term, customSynonyms, selectedSynonyms) : saveSynonymsResponse

Description🔗

Same as saveSynonym method but with accessToken instead of environment, password, and user.

Method deleteAllSynonymsForUser🔗

Method call🔗

deleteAllSynonymsForUser(environment, password, user) : deleteAllSynonymsForUserResponse

Description🔗

Deletes all custom synonyms (added synonyms and remembered synonym selections) for the given user.

This service is only available through the SOAP protocol.

Parameters🔗

Parameter Name Type Description
environment string identifier of a search environment
password string password for the search environment
user string identifier for the user

Returns🔗

Result Name Type Description
deleteSynonymResponse string OK on success

Pre-Condition🔗

None.

Post-Condition🔗

All custom synonyms (added and remembered selections) of the given user are removed from the database.

Error Handling🔗

See the description of common errors above.