Retrieving all the terms of a synonyms list
Use this API to retrieve all synonyms from a list.
Requirement: OpenSearchServer v1.5
Call parameters
URL: /services/rest/index/{index_name}/synonyms/{list_name}
Method: GET
Header:
- Accept (optional returned type):
application/json
orapplication/xml
URL parameters:
- index_name (required): The name of the index.
- list_name (required): The name of the target list.
Success response
All synonyms within the list are returned. One group of synonyms by line, each synonym separated by a comma:
couch,divan,sofa
desk,bureau
HTTP code:
200
Content (application/json):
Error response
The command failed. The reason is provided in the content.
HTTP code:
500
Sample call
Using CURL:
curl -XGET http://localhost:8080/services/rest/index/my_index/synonyms/my_list
Using jQuery:
$.ajax({
type: "GET",
dataType: "json",
url: "http://localhost:8080/services/rest/index/my_index/synonyms/my_list"
}).done(function (data) {
console.log(data);
});