Methods are provided for creating, deleting, and retrieving information about indexes.:
Create an index for the specified table and database. Each field included in the body will comprise a segment of the index in the order given.
Type: POST
URL: /ctree/api/v1/index/{db}/{table}/{index}
Parameters:
Body:
A JSON string containing an array of objects specifying segments to add to the index, as well as settings for the index. Each object will consist of a field name and settings for the segment.
The fields property is an array of objects consisting of the following:
The name property is a required string identifying a field by name to include in the index.
The ascending property is an optional Boolean (defaults to true) that controls the collation direction of this index segment. Setting it to true causes the segment to put the "smallest" value first ascending to the "largest" value. Setting it to false reverses this segment to go from "largest" descending to "smallest".
Example:
{
"fields": [{
"name": "part_name"
},
{
"name": "part_number",
"ascending": false
}
],
"unique": true
}
JSON field Example:
{
"fields": [{
"name": "json_field",
"key": "my_important_property",
"type": "string",
"size": 100
}]
}
When you want to connect using a secure connection over TLS, use https:// and port 8443. Without TLS use http:// and port 8080.
Response:
Delete an existing index in the specified table and database.
Type: DELETE
URL: /ctree/api/v1/index/{db}/{table}/{index}
Parameters:
Example:
DELETE https://localhost:8443/ctree/api/v1/index/ctreeSQL/part/name
When you want to connect using a secure connection over TLS, use https:// and port 8443. Without TLS use http:// and port 8080.
Response:
Get the definition of an index in the specified table and database.
Type: GET
URL: /ctree/api/v1/index/{db}/{table}/{index}
Parameters:
Example:
GET https://my-ctree-server:8443/ctree/api/v1/index/ctreeSQL/books/idxname
When you want to connect using a secure connection over TLS, use https:// and port 8443. Without TLS use http:// and port 8080.
Response:
{
"unique": true,
"fields": [
{
"name": "part_name",
"ascending": true
},
{
"name": "part_number",
"ascending": false
}
]
}
Get a list of all indexes on the specified table and database.
Type: GET
URL: /ctree/api/v1/index/{db}/{table}
Parameters:
Example:
GET https://my-ctree-server:8443/ctree/api/v1/index/ctreeSQL/books
When you want to connect using a secure connection over TLS, use https:// and port 8443. Without TLS use http:// and port 8080.
Response:
{
"_indexes": [
name"
]
}