All Products
Search
Document Center

OpenSearch:Getting started

Last Updated:Aug 27, 2024

Prerequisites

  1. An Alibaba Cloud account is created and the real-name verification is complete.

  2. When you log on to the console for the first time by using your Alibaba Cloud account, you are prompted to create an AccessKey pair before you perform subsequent operations.

  • You must specify an AccessKey pair for your Alibaba Cloud account because the AccessKey pair is required when you create and use an OpenSearch application.

  • After you create an AccessKey pair for your Alibaba Cloud account, you can create an AccessKey pair for a RAM user. This way, you can access the application as the RAM user. For more information about how to grant permissions to RAM users, see RAM authorization.

  1. A virtual private cloud (VPC) is available. For more information, see What is a VPC?

Note

If you want to access an OpenSearch Retrieval Engine Edition instance as a RAM user, you must grant the AliyunSearchEngineFullAccess or AliyunSearchEngineReadOnlyAccess permission to the RAM user by using your Alibaba Cloud account.

Purchase an instance

  1. Log on to the OpenSearch console. In the upper-left corner, switch to OpenSearch Retrieval Engine Edition.

  2. In the left-side navigation pane, click Instance Management. On the page that appears, click Create Instance.

  1. Set the Service Edition parameter to Retrieval Engine Edition, select a region, and configure the Query Node Quantity, Query Node Type, Data Node Quantity, Data Node Type, Free Storage Space of Single Data Node, VPC, vSwitch, Username, and Password parameters as prompted. The password is used for authentication during queries and is not the password of your Alibaba Cloud account. Then, click Buy Now.

Note
  • Specify the numbers and specifications of Query Result Searcher (QRS) workers and Searcher workers that you want to purchase based on your business requirements. After you specify the specifications, the actual fee is automatically displayed on the buy page.

  • The VPC and vSwitch that you specify must be consistent with those configured for the Elastic Compute Service (ECS) instance that you use to access the OpenSearch Retrieval Engine Edition instance. Otherwise, the error {'errors':{'code':'403','message':'Forbidden'}} is returned when you access the OpenSearch Retrieval Engine Edition instance.

  • A free quota of storage space is provided for each Searcher worker. You can increase the quota in increments of 50 GB. If the total storage space exceeds the free quota, you are charged for the excess storage space.

  1. On the Confirm Order page, check the configurations and the service agreement and click Activate Now.

  2. After you purchase the instance, click Console. On the Instance Management page, you can view the purchased instance.

  1. By default, the name of the instance is automatically set. To modify the name of the instance, click Manage in the Actions column to go to the details page of the instance.

Click the Modify icon, modify the instance name as prompted, and then click Confirm.

Configure a cluster

On the details page of the purchased instance, you can view that the instance is in the Pending Configuration state and an empty cluster is automatically deployed for the instance. The numbers and specifications of QRS workers and Searcher workers in the cluster are those you specify when you purchase the instance. You must configure a data source and an index schema and rebuild indexes for the cluster before you can use the search service.

  1. Configure the data source. You can configure a MaxCompute data source or an API data source. In this example, a MaxCompute data source is used. To configure a MaxCompute data source for the cluster, perform the following operations: In the Configure Data Source step, click Add Data Source. In the Add Data Source panel, specify MaxCompute as the data source type. Configure the Project, AccessKey ID, AccessKey Secret, Table, and Partition Key parameters. You can specify whether to enable Automatic Reindexing based on your business requirements.

After the verification is passed, click OK to add the data source.

  1. After the data source is configured, click Next to configure the index schema.

2.1. Before you configure the index schema, no index schema version exists and you are prompted to add an index table. To do so, click Add Index Table.

2.2. Configure an index table.

  • Index Table: Enter a custom name.

  • Data Source: Select the data source that you configure in Step 1.

  • Data Shards: Enter a value based on the number of Searcher workers that you purchase.

2.3. Configure fields.

Specify whether to compress attribute fields and field data:

  • Attribute fields: By default, attribute fields are not compressed. If file_compressor is selected for an attribute field, the attribute field is compressed.

  • Field data: By default, field data is not compressed. For multi-value fields or fields of the STRING type, uniq is selected by default. For single-value fields, equal is selected by default.

Note

If you compress attribute fields, we recommend that you modify the index loading method to reduce the impact on performance. To modify the index loading method, perform the following operations: On the instance details page of an instance, click Deployment Management. On the page that appears, click the Searcher worker that you want to manage. In the Searcher Worker Configurations panel, click the Online Table Configurations tab.

2.4. Configure the indexes.

  • By default, index fields are not compressed. If file_compressor is selected for an index field, the index field is compressed.

Note
  • The primary key index cannot be compressed.

  • If you compress index fields, we recommend that you modify the index loading method to reduce the impact on performance. To modify the index loading method, perform the following operations: On the instance details page of an instance, click Deployment Management. On the page that appears, click the Searcher worker that you want to manage. In the Searcher Worker Configurations panel, click the Online Table Configurations tab.

  1. After the configuration is complete, click Save Version. In the dialog box that appears, enter the description and click Publish. The description is optional.

After the index is published, click Next to rebuild the index.

  1. Rebuild the index. Configure the parameters based on your index rebuilding requirements and click Next.

  • API data source

  • MaxCompute data source

View the reindexing progress

After the data source and index schema are configured, you can view the cluster topology on the Deployment Management page.

After the configuration is updated, you can choose O&M Center > Change History in the left-side navigation pane. On the page that appears, you can view the reindexing progress on the Data Source Changes tab.

On the details page of the instance, you can view the status of the QRS workers and Searcher workers of the cluster. If the status is normal, you can perform a query test.

Perform a query test

Choose Extended Features > Query Test in the left-side navigation pane. On the page that appears, you can perform a basic query test. Both HA3 query clauses and SQL clauses are supported.

Note

Usage notes:

Important
  • OpenSearch Retrieval Engine Edition supports only the pay-as-you-go billing method.

  • The username and password that you set when you purchase an instance can be modified on the details page of the instance.

  • The cluster is specified by the system when you purchase an instance, and you cannot modify the cluster name.