Retrieving a More-Like-This template

This API returns the content of a MoreLikeThis template.

Requirement: OpenSearchServer v1.5.3

Call parameters

URL: /services/rest/index/{index_name}/morelikethis/template/{template_name}

Method: GET

URL parameters:

  • index_name (required): The name of the index.
  • template_name (required): The name of the MoreLikeThis template.

Header (optional returned type):

  • Accept: application/json or application/xml

Success response

The field is returned either in JSON format or in XML format.

HTTP code:

Content (application/json):

"likeText":"open search server",
"English stop words",

Error response

The MoreLikeThis template was not returned. The reason is provided in the content.

HTTP code:
500, 404 (other than 200)

Content (text/plain):

Template not found: my_mlt

Sample call

Using CURL:

curl -XGET http://localhost:9090/services/rest/index/my_index/morelikethis/template/my_mlt

Using jQuery:

type: "GET",
dataType: "json",
url: "http://localhost:9090/services/rest/index/my_index/morelikethis/template/my_mlt"
}).done(function (data) {

View/edit on GitHub