The Search Active Queries REST API is provided by the Search service. This API enables you to get information about active Search queries.
Version : 7.6
{scheme}://{host}:{port}
The URL scheme, host, and port are as follows.
| Component | Description |
|---|---|
scheme |
The URL scheme. Use Values: |
host |
The host name or IP address of a node running the Search Service. Example: |
port |
The Search Service REST port. Use Values: |
This section describes the operations available with this REST API.
GET /api/query
Gets the details of all the active queries in any Search node in a cluster.
-
application/json
| Name | Description | Schema |
|---|---|---|
longerThan |
Filters the queries running beyond the given span of time. The duration string is a signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as |
String (duration) |
| HTTP Code | Description | Schema |
|---|---|---|
200 |
A list of all active Search queries across all nodes in the cluster. |
| Type | Name |
|---|---|
http (basic) |
POST /api/query/{queryID}/cancel
Allows the user to cancel an active query that’s running longer than expected.
Use the View Active Index Queries API or the View Active Node Queries API to get the parameters queryID and uuid, which are used to identify and cancel the query.
-
application/json
-
application/json
| Name | Description | Schema |
|---|---|---|
queryID |
The ID of the active query. This ID is used to identify the query that you want to cancel. |
Integer |
| Name | Description | Schema |
|---|---|---|
Body |
The body contains the UUID of the node where the query is running. This is optional and allows cancellation of queries on specific nodes. |
| HTTP Code | Description | Schema |
|---|---|---|
200 |
The query was successfully canceled. |
| Type | Name |
|---|---|
http (basic) |
GET /api/query/index/{indexName}
Gets the details of all the active queries for any given Search index in the system.
-
application/json
| Name | Description | Schema |
|---|---|---|
indexName |
The name of the Search index. |
String |
| Name | Description | Schema |
|---|---|---|
longerThan |
Filters the queries running beyond the given span of time. The duration string is a signed sequence of decimal numbers, each with optional fraction and a unit suffix, such as |
String (duration) |
| HTTP Code | Description | Schema |
|---|---|---|
200 |
A list of active queries for the specified Search index. |
| Type | Name |
|---|---|
http (basic) |
This section describes the properties consumed and returned by this REST API.
Active Response
Filtered Active Queries
Query Map
Query Map Item
Query Context
Stats
Cancellation Request
Cancellation Response
| Property | Schema | |
|---|---|---|
status |
The status of the request. |
String |
stats |
||
totalActiveQueryCount |
The total number of active queries. |
Integer |
filteredActiveQueries |
| Property | Schema | |
|---|---|---|
indexName |
The name of the Search index. Only included if viewing active queries for a specific index. |
String |
longerThan |
The duration used to filter the active queries.
Only included if the |
String (duration) |
queryCount |
The number of filtered active queries. |
Integer |
queryMap |
| Property | Schema | |
|---|---|---|
QueryContext |
||
executionTime |
The time taken to execute the query. |
String (duration) |
| Property | Schema | |
|---|---|---|
query |
An object containing the Search query. For more information, see [Search Request JSON Properties](../search/search-request-params.html). |
Object |
size |
Example: |
Integer |
from |
Example: |
Integer |
timeout |
Example: |
Integer |
index |
The name of a Search index. |
String |
| Property | Schema | |
|---|---|---|
total |
Example: |
Integer |
successful |
Example: |
Integer |
| Property | Schema | |
|---|---|---|
uuid |
Represents the active query’s coordinator node’s UUID, where the query will be canceled. This parameter allows the user to cancel a query anywhere in the system by specifying its coordinator node’s UUID. |
String |