All Products
Search
Document Center

OpenSearch:Query syntax

Last Updated:Apr 01, 2026

Turing SQL uses two clauses to construct queries: query for the SQL statement and kvpair for parameters. Send queries to the /sql path as HTTP requests, which you can build manually or run with curl.

Prerequisites

Before you begin, ensure that you have:

  • The service IP address and port of the OpenSearch Retrieval Engine Edition V3.0 QRS

Run a query

Send a query to the /sql endpoint using curl:

curl "ip:port/sql?query=SELECT brand, COUNT(*) FROM phone GROUP BY (brand)&&kvpair=trace:INFO;formatType:json"

The request combines two clauses:

  • query: the SQL statement to execute

  • kvpair: a semicolon-separated list of parameters

kvpair syntax

Separate multiple kvpair parameters with semicolons (;). The example above passes two parameters:

ParameterValue
traceINFO
formatTypejson
Important

Do not include spaces between kvpair and &&, or between kvpair parameters. Spaces cause the query to fail at parse time.

Query paths

PathDescription
/sqlSQL query path for Turing SQL
/OpenSearch Retrieval Engine Edition V3.0 query path