Loading TOC...
Matches for cat:rest-api (cat:rest-api) have been highlighted. remove

MarkLogic Server 11.0 Product Documentation
GET /v1/config/indexes

Summary

Request a report on whether or not the database configuration includes index configurations that satisfy all installed query options.

URL Parameters
format? The format of the content returned by by the request, either xml (default), json, or html. The format parameter overrides any format specified in the Accept header.
Request Headers
Accept* The expected MIME type of the response. Accepted values: application/json, application/html, or text/XML (the default). If the format parameter is set, the Accept header is ignored in favor of the format parameter.
Response Headers
Content-Type The MIME type of the content returned in the response body, one of application/xml, application/json, or text/html.

Response

Upon success, MarkLogic Server responds with status 200 and the index report in the response body.

Required Privileges

This operation requires the rest-reader role, or the following privilege:

http://marklogic.com/xdmp/privileges/rest-reader

Usage Notes

Use this service to determine whether the database attached to your REST API instance includes all the indexes required to support the installed query options (created using the /config/query service).

The expected response type can be specified using either the format parameter or Accept header. One or the other must be supplied. If both are supplied and are different, the format parameter takes precedence.

For more details, see Checking Index Availability in the REST Application Developer's Guide.

Example

$ curl --anyauth --user user:password -X GET -H "Accept: application/xml" \
     http://localhost:8004/v1/config/indexes

==> MarkLogic server responds with a 200 status and the requested
    report, as XML. For example, this report shows one missing
    path range index:

<rapi:index-summaries xmlns:rapi="http://marklogic.com/rest-api">
  <rapi:index-count>2</rapi:index-count>
  <rapi:complete>false</rapi:complete>
  <rapi:index-summary>
    <rapi:name>/v1/config/query/default</rapi:name>
    <rapi:complete>true</rapi:complete>
  </rapi:index-summary>
  <rapi:index-summary>
    <rapi:name>/v1/config/query/tuples</rapi:name>
    <rapi:complete>false</rapi:complete>
    <range type="xs:string" xmlns="http://marklogic.com/appservices/search">
      <path-index>/PLAY/ACT/SCENE/TITLE</path-index>
    </range>
  </rapi:index-summary>
</rapi:index-summaries>
  

Example

$ curl --anyauth --user user:password -X GET -H "Accept: application/json" \
     http://localhost:8004/v1/config/indexes

==> MarkLogic server responds with a 200 status and the requested
    report, as JSON. For example, this report shows one missing
    path range index:

{
  "index-summaries": {
    "index-summary": [
      {
        "name": "/v1/config/query/default",
        "complete": "true"
      },
      {
        "name": "/v1/config/query/tuples",
        "complete": "false",
        "range": {
          "type": "xs:string",
          "path-index": "/PLAY/ACT/SCENE/TITLE"
        }
      }
    ],
    "index-count": "2",
    "complete": "false"
  }
}
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.