Skip to content

Latest commit

 

History

History
1552 lines (858 loc) · 26 KB

File metadata and controls

1552 lines (858 loc) · 26 KB

Couchbase Search Active Queries REST API

Overview

The Search Active Queries REST API is provided by the Search service. This API enables you to get information about active Search queries.

Version information

Version : 7.6

Host information

{scheme}://{host}:{port}

The URL scheme, host, and port are as follows.

Component Description

scheme

The URL scheme. Use https for secure access.

Values: http, https
Example: http

host

The host name or IP address of a node running the Search Service.

Example: localhost

port

The Search Service REST port. Use 18094 for secure access.

Values: 8094, 18094
Example: 8094

Resources

This section describes the operations available with this REST API.

View Active Node Queries

GET /api/query

Description

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

Produces
  • application/json

Parameters

Query Parameters

Name Description Schema

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)

Responses

HTTP Code Description Schema

200

A list of all active Search queries across all nodes in the cluster.

Cancel Active Queries

POST /api/query/{queryID}/cancel

Description

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.

Consumes
  • application/json

Produces
  • application/json

Parameters

Path Parameters

Name Description Schema

queryID
required

The ID of the active query. This ID is used to identify the query that you want to cancel.

Integer

Body Parameter

Name Description Schema

Body
optional

The body contains the UUID of the node where the query is running. This is optional and allows cancellation of queries on specific nodes.

Responses

HTTP Code Description Schema

200

The query was successfully canceled.

View Active Index Queries

GET /api/query/index/{indexName}

Description

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

Produces
  • application/json

Parameters

Path Parameters

Name Description Schema

indexName
required

The name of the Search index.

String

Query Parameters

Name Description Schema

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)

Responses

HTTP Code Description Schema

200

A list of active queries for the specified Search index.

Definitions

This section describes the properties consumed and returned by this REST API.

Active Response

[brackets curly] Object

Property Schema

status
optional

The status of the request.

String

stats
optional

totalActiveQueryCount
optional

The total number of active queries.

Integer

filteredActiveQueries
optional

Filtered Active Queries

[brackets curly] Object

Property Schema

indexName
optional

The name of the Search index. Only included if viewing active queries for a specific index.

String

longerThan
optional

The duration used to filter the active queries. Only included if the longerThan query parameter is used.

String (duration)

queryCount
optional

The number of filtered active queries.

Integer

queryMap
optional

Query Map

[brackets curly] Object

Property Schema

additional
property

Query Map Item

[brackets curly] Object

Property Schema

QueryContext
optional

executionTime
optional

The time taken to execute the query.

String (duration)

Query Context

[brackets curly] Object

Property Schema

query
optional

An object containing the Search query. For more information, see [Search Request JSON Properties](../search/search-request-params.html).

Object

size
optional

Example: 10

Integer

from
optional

Example: 0

Integer

timeout
optional

Example: 120000

Integer

index
optional

The name of a Search index.

String

Stats

[brackets curly] Object

Property Schema

total
optional

Example: 3

Integer

successful
optional

Example: 3

Integer

Cancellation Request

[brackets curly] Object

Property Schema

uuid
optional

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

Cancellation Response

[brackets curly] Object

Property Schema

status
optional

The status of the request.

String

msg
optional

The response message, giving details of the node UUID and query ID.

String