Active Queries REST API
Overview
The Active Queries REST API is provided by the Search service. This API enables you to get information about active FTS queries.
The API schemes and host URLs are as follows:
-
http://node:8094/
-
https://node:18094/
(for secure access)
where node
is the host name or IP address of a computer running the Search service.
Paths
Table of Contents
View Active Index Queries
GET /api/query/index/{indexName}
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Path |
indexName |
The name of a full-text index. |
string |
Query |
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) |
Example HTTP request
Request 1: Find queries on the index DemoIndex
that have been running for longer than 1 ms.
curl -XGET -H "Content-Type: application/json" \
-u Administrator:asdasd \
'http://localhost:8094/api/query/index/DemoIndex?longerThan=1ms'
Example HTTP response
Result of request 1.
{
"status": "ok",
"totalActiveQueryCount": 3,
"filteredActiveQueries": {
"indexName": "DemoIndex",
"longerThan": "1s",
"queryCount": 3,
"queryMap": {
"4": {
"QueryContext": {
"query": {
"query": "ipa"
},
"size": 10,
"from": 0,
"timeout": 10000,
"index": "DemoIndex"
},
"executionTime": "17.340715297s"
},
"5": {
"QueryContext": {
"query": {
"query": "german"
},
"size": 10,
"from": 0,
"timeout": 10000,
"index": "DemoIndex"
},
"executionTime": "9.561917571s"
},
"6": {
"QueryContext": {
"query": {
"query": "pale ale"
},
"size": 10,
"from": 0,
"timeout": 10000,
"index": "DemoIndex"
},
"executionTime": "1.239720897s"
}
}
}
}
View Active Node Queries
GET /api/query
Parameters
Type | Name | Description | Schema |
---|---|---|---|
Query |
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) |
Example HTTP request
Request 2: Find all queries on the node localhost
.
curl -XGET -H "Content-Type: application/json" \
-u UserName:Password \
http://localhost:8094/api/query
Request 3: Find all queries on the node localhost
that have been running for longer than 10s.
curl -XGET -H "Content-Type: application/json" \
-uAdministrator:asdasd \
'http://localhost:8094/api/query?longerThan=10s'
Example HTTP response
Result of request 2.
{
"status": "ok",
"totalActiveQueryCount": 3,
"filteredActiveQueries": {
"queryCount": 3,
"queryMap": {
"10": {
"QueryContext": {
"query": {
"query": "american"
},
"size": 10,
"from": 0,
"timeout": 10000,
"index": "DemoIndex1"
},
"executionTime": "9.700851426s"
},
"11": {
"QueryContext": {
"query": {
"query": "russian"
},
"size": 10,
"from": 0,
"timeout": 10000,
"index": "DemoIndex2"
},
"executionTime": "2.216451567s"
},
"9": {
"QueryContext": {
"query": {
"query": "german"
},
"size": 10,
"from": 0,
"timeout": 10000,
"index": "DemoIndex"
},
"executionTime": "13.863849125s"
}
}
}
}
Result of request 3.
{
"status": "ok",
"totalActiveQueryCount": 0,
"filteredActiveQueries": {
"indexName": "DemoIndex",
"queryCount": 0,
"queryMap": {}
}
}