A newer version of this documentation is available.

View Latest

Active Queries REST API

    March 23, 2025
    + 12

    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.

    Version information

    Version : 7.0

    Produces

    • application/json

    Paths

    Table of Contents

    View Active Index Queries

    GET /api/query/index/{indexName}

    Description

    Gets the details of all the active queries for any given FTS index in the system.

    Parameters

    Type Name Description Schema

    Path

    indexName
    required

    The name of a full-text index.

    string

    Query

    longerThan
    optional

    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 20s, -1.5h or 2h45m. Valid time units are ns, us (or µs), ms, s, m, h.

    string (duration)

    Example HTTP request

    Request 1: Find queries on the index DemoIndex that have been running for longer than 1 ms.

    Curl request
    shell
    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.

    Response 200
    json
    { "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

    Description

    Gets the details of all the active queries in any FTS node in a cluster.

    Parameters

    Type Name Description Schema

    Query

    longerThan
    optional

    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 20s, -1.5h or 2h45m. Valid time units are ns, us (or µs), ms, s, m, h.

    string (duration)

    Example HTTP request

    Request 2: Find all queries on the node localhost.

    Curl request
    shell
    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 request
    shell
    curl -XGET -H "Content-Type: application/json" \ -uAdministrator:asdasd \ 'http://localhost:8094/api/query?longerThan=10s'

    Example HTTP response

    Result of request 2.

    Response 200
    json
    { "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.

    Response 200
    json
    { "status": "ok", "totalActiveQueryCount": 0, "filteredActiveQueries": { "indexName": "DemoIndex", "queryCount": 0, "queryMap": {} } }