Query test

更新时间:
复制 MD 格式

After you deploy a cluster, you can test your search capabilities. OpenSearch Vector Search Edition provides a built-in Query Test feature in the console, offering various clause configurations to build and run queries tailored to your specific search requirements.

Procedure

  1. In the OpenSearch Vector Search Edition console, go to the Instances > Query Test page. You will find a dropdown menu for the query type, including SQL Query, Havenask Query, and REST API Query, and a Search button.

  1. On the Query Test page, select a query type such as SQL Query, Havenask Query, or REST API Query to search using the corresponding syntax. Add additional clauses as needed, and then click Search to execute the query and view the results.

Havenask query

Selecting Havenask Query from the dropdown menu displays input fields for the query string and clauses. The query statement is a mandatory part of a Havenask Query. The config and cluster clauses are also required and are added by default. You can add other clauses as needed.

Havenask Query results:

In the upper-right corner of the page, you can set the number of Display Fields (default: 10) and enable the Show URL toggle. When enabled, the page displays the complete concatenated query URL in the format query=...&&config=...&&cluster=.... After the query executes, the results show the number of matched documents, the time taken, and the details of the returned fields for each document, such as id, fb_datetime, fb_string, and fb_boolean.

SQL query

Select SQL Query from the dropdown menu. The query field is required. Enter your query statement and click Search.

You can add a kvpair clause as needed.

For example, to query by ID, enter select * from index_a where id = 7370577090061071286 in the query input box. After you click Search, the query time (USE_TIME), number of rows returned (ROW_COUNT), and matched field details are displayed at the bottom of the page.

SQL Query results:

For example, enter select * from index_a in the query field and add format:full_json in the kvpair field. On the right, you can set the number of Display Fields (for example, 10) and enable the Show URL and Raw Mode toggles. After execution, the results area displays the query time (USE_TIME), the number of rows returned (ROW_COUNT), and the data for each column.

REST API query

Select REST API Query from the dropdown menu, choose an index table, enter your query statement in the input box on the left, and then click Search.

Enter the REST API query string and click Search. The results are displayed on the right:

The REST API Query interface provides an index table dropdown at the top to select the target index. The query input box is on the left, and the results area is on the right. After you enter a query and click Search, the results are displayed in JSON format.

{
  "query": "index_id:12"
}

Query syntax