All Products
Search
Document Center

OpenSearch:Primary key-based query

Last Updated:Nov 05, 2024

After the reindexing is complete, you can go to the Query Test page in the OpenSearch Vector Search Edition console to run query tests. On the Query Test page, you can perform the following types of queries: vector-based query, primary key-based query, and hybrid query by vector and text. This topic describes how to perform a primary key-based query.

Procedure

On the details page of your OpenSearch instance, click Query Test in the left-side navigation pane. On the Primary Key-based Query tab, select the table whose data you want to query from the Table Name drop-down list. You can select Form Mode or Developer Mode from the drop-down list in the upper-right corner. By default, Form Mode is selected.

image

Form mode

If you select Form Mode, the query parameters are displayed in a form. The query results are displayed below the form. Some query features are disabled.

image

The following section describes the query parameters:

  1. Table Name: required. The table whose data you want to query. Select a table in the In Use state from the Table Name drop-down list.

  2. Primary Key: required. The one or more primary key values. Separate multiple primary key values with commas (,). Example: 1,2,3.

Enter one or more primary key values that you want to query and click Search. Separate multiple primary key values with commas (,). The query results are displayed below the form, as shown in the following figure.

image

Developer mode

The query parameters and query results are displayed in the format of original statements. All query features are supported.

image

Configure the query parameters based on your business requirements in the left-side section and click Search. The query results are displayed in the right-side section. The following figure provides an example.

image

{
  "ids": ["1","2"]
}
  • ids: Enter one or more primary key values in the list[] format. Separate multiple primary key values with commas (,).

Usage notes

  • Primary key-based queries can be performed based only on the table name and primary key values.