# opensearch-search

Part of **OPENSEARCH**

# OpenSearch Search Console Guide

## Operations Overview

| Operation | Console Navigation Path | Prerequisites | Description |
|------|-----------|---------|------|
| Create and Configure Instance | Console > OpenSearch > Instance Management > Create Instance | Alibaba Cloud account with real-name verification, VPC and subnet created, security group rules configured | Set up a new OpenSearch instance with network and access settings |
| Run Basic Search | Console > OpenSearch > Applications > Search | OpenSearch application created, AccessKey pair configured as environment variables | Perform basic search operations through the console interface |
| Test Search Query | Instance Management > Management > Query Test | Successful cluster deployment | Validate search queries using SQL, HA3, or RESTAPI syntax |
| Configure Stop Word Filtering | Console > Search Algorithm Center > Retrieval Configuration > Query Analysis Rule Management | Access to OpenSearch console, existing application | Set up rules to exclude common words from search queries |
| Configure Synonym Rules | Console > Search Algorithm Center > Retrieval Configuration > Query Analysis Rule Management | Access to OpenSearch console, existing application with version selected | Define synonym relationships to expand search queries |
| Configure Query Analysis Rule | Console > Search Algorithm Center > Retrieval Configuration > Query Analysis Rule Management | Access to OpenSearch console, application with version configured | Set up term weight analysis rules for query processing |
| Push Documents and Search | Console > OpenSearch > Applications > Create Application | AccessKey ID/secret as environment variables, OpenSearch application created | Upload documents and perform search operations via the console |
| Implement Dropdown Suggestions | Console > Instances > Instance List > [Instance] > API Entrance > Public API | OpenSearch instance created, AccessKey configured as environment variables | Set up and configure dropdown suggestions through the console |
| Configure Text Search | Console > AI Search Open Platform > RAG > Experience Center | AI Search Open Platform activated, API key available | Set up text vectorization and sparse embedding for search |
| Perform Fuzzy Search | Console > OpenSearch > Applications > Create Application | Application with SHORT_TEXT field type, fuzzy search analyzer assigned | Execute fuzzy text searches through the console interface |

## Operations Steps

### Create and Configure Instance

**Navigation**: Console > OpenSearch > Instance Management > Create Instance

**Prerequisites**:
- Alibaba Cloud account with real-name verification completed
- VPC and subnet already created
- Security group rules configured to allow access to required ports

1. Click the **Create Instance** button
   - Element: **Create Instance** (button) — located in the top operation bar of the instance list page
   - Notes: This opens the instance creation form

2. Select instance specifications and region
   - Element: **Instance Specifications** (dropdown) — in the instance creation form
   - Notes: Choose based on your data volume and query load requirements

3. Configure network settings by selecting existing VPC and subnet
   - Element: **Network Configuration** (tab) — in the left navigation of the creation form
   - Notes: Must select VPC that matches your application service location

4. Set access control policy to enable public or private network access
   - Element: **Access Control** (text_input) — in the advanced settings section
   - Notes: Private network access is recommended for production environments

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Instance Name | text | Yes | — | Unique identifier for the instance |
| Instance Type | radio | Yes | Standard Edition, Enterprise Edition, Dedicated Edition | Different editions support varying features and performance levels |
| Storage Capacity | number | Yes | — | Initial storage space size (GB) |

### Run Basic Search

**Navigation**: Console > OpenSearch > Applications > Search

**Prerequisites**:
- OpenSearch application created in the console
- AccessKey ID and AccessKey secret configured as environment variables
- Endpoint URL obtained from application details page

1. Set environment variables for AccessKey credentials
   - Element: **ALIBABA_CLOUD_ACCESS_KEY_ID** (text_input) — in system environment variables
   - Notes: Required before running any search operations

2. Set environment variables for AccessKey secret
   - Element: **ALIBABA_CLOUD_ACCESS_KEY_SECRET** (text_input) — in system environment variables
   - Notes: Keep this value secure

3. If using Windows OS, restart the system
   - Element: **Restart** (button) — in System Settings
   - Notes: Environment variable changes require restart to take effect on Windows

### Test Search Query

**Navigation**: Instance Management > Management > Query Test

**Prerequisites**:
- Successful cluster deployment completed

1. Navigate to the Query Test page in the console
   - Element: **Query Test** (link) — under Instance Management > Management section
   - Notes: The console navigation path is visible in the UI

2. Select a clause type from the dropdown options
   - Element: **Dropdown list** (dropdown) — at the top of the Query Test interface
   - Notes: Choose between SQL Query, HA3 Query, or RESTAPI Query

3. Enter your query statement in the input field
   - Element: **query field** (text_input) — in the input area below the dropdown
   - Notes: This field is required for all clause types

4. Click Search to execute the query
   - Element: **Search** (button) — on the right side of the input area
   - Notes: Results will display in the right panel

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Clause Type | dropdown | Yes | SQL Query, HA3 Query, RESTAPI Query | Specifies the query syntax format to use |
| Query | text | Yes | — | The actual query statement in the selected syntax |
| Index Table | dropdown | No | — | Available only for RESTAPI Query; specifies target index |
| kvpair | text | No | — | Optional clause for SQL queries to add key-value pairs |

### Configure Stop Word Filtering

**Navigation**: Console > Search Algorithm Center > Retrieval Configuration > Query Analysis Rule Management

**Prerequisites**:
- Access to the OpenSearch console
- Existing application with online or offline version

1. Log on to the OpenSearch console and navigate to Search Algorithm Center > Retrieval Configuration
   - Element: **Search Algorithm Center &gt; Retrieval Configuration** (link) — in left-side navigation pane
   - Notes: This is the starting point for query analysis configuration

2. Click on Query Analysis Rule Management in the left-side pane
   - Element: **Query Analysis Rule Management** (link) — in left-side pane
   - Notes: Opens the rule management interface

3. Select an application name and version, then click Create
   - Element: **Create** (button) — in top-right corner of the page
   - Notes: You must select either online or offline version

4. In the Add Rule panel, configure rule settings and select Stop Word
   - Element: **OK** (button) — at bottom of the Add Rule panel
   - Notes: Rule Name, Index Range, and Industry Type are required fields

5. Run a search test to verify query analysis functionality
   - Element: (none specified) — 
   - Notes: Use provided screenshots to confirm the query analysis process works correctly

6. Switch to Index Orientation tab to set the rule as default
   - Element: **Index Orientation** (tab) — in top navigation bar
   - Notes: This makes the rule active for indexing operations

7. Verify the default query analysis rule is correctly applied
   - Element: (none specified) — 
   - Notes: Confirm via the UI screenshot that the rule is set as default

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Rule Name | text | Yes | — | Unique name for the query analysis rule |
| Index Range | text | Yes | — | Specifies which index(es) this rule applies to |
| Industry Type | dropdown | Yes | — | Selects industry context for rule customization |
| Rule Type | dropdown | Yes | Stop Word | Enables stop word filtering functionality |

### Configure Synonym Rules

**Navigation**: Console > Search Algorithm Center > Retrieval Configuration > Query Analysis Rule Management

**Prerequisites**:
- Access to the OpenSearch console
- Existing application with online or offline version selected
- Permissions to create and manage query analysis rules

1. Log on to the OpenSearch console and navigate to Search Algorithm Center > Retrieval Configuration
   - Element: **Search Algorithm Center &gt; Retrieval Configuration** (link) — in left-side navigation pane
   - Notes: Starting point for all retrieval configuration tasks

2. Click on Query Analysis Rule Management in the left-side pane
   - Element: **Query Analysis Rule Management** (link) — in left-side pane
   - Notes: Opens the rule management interface

3. Select an application name and version, then click Create
   - Element: **Create** (button) — in top-right corner of the page
   - Notes: Must select either online or offline version

4. In the Add Rule panel, enter rule details and select Synonym as rule type
   - Element: **OK** (button) — at bottom of the Add Rule panel
   - Notes: Built-in dictionary used if no intervention dictionary specified

5. Run a search test to verify query analysis process
   - Element: **Run a search test** (button) — on the Query Analysis Rule Management page
   - Notes: View the query analysis process in the provided screenshot

6. Switch to Index Orientation tab to set rule as default
   - Element: **Index Orientation** (tab) — at top of the Query Analysis Rule Management page
   - Notes: Makes the rule active for indexing operations

7. Confirm the default query analysis rule is correctly applied
   - Element: **Check the default query analysis rule** (button) — on the Query Analysis Rule Management page
   - Notes: Verify the setting through the displayed UI

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Rule Name | text_input | Yes | — | Unique name for the query analysis rule |
| Indexes | dropdown | Yes | — | The index(es) to which this rule applies |
| Rule Type | dropdown | Yes | Synonym | Enables synonym-based query analysis |

### Configure Query Analysis Rule

**Navigation**: Console > Search Algorithm Center > Retrieval Configuration > Query Analysis Rule Management

**Prerequisites**:
- Access to OpenSearch console
- Application with online or offline version configured

1. Log on to the OpenSearch console and navigate to Search Algorithm Center > Retrieval Configuration
   - Element: **Search Algorithm Center &gt; Retrieval Configuration** (link) — in left-side navigation pane
   - Notes: Primary navigation path for retrieval configuration

2. Click on Query Analysis Rule Management in the left-side pane
   - Element: **Query Analysis Rule Management** (link) — in left-side pane
   - Notes: Opens the rule management interface

3. Select an application name and version, then click Create
   - Element: **Create** (button) — in top-right corner of the page
   - Notes: Must choose between online or offline version

4. In the Add Rule panel, configure rule settings and select Word Weight
   - Element: **OK** (button) — at bottom of the Add Rule panel
   - Notes: Complete all required fields before confirming

5. Run a search test to verify query analysis functionality
   - Element: **Run a search test** (button) — in main content area
   - Notes: Reference the screenshot showing query analysis process

6. Switch to Index Orientation tab to set rule as default
   - Element: **Index Orientation** (tab) — in top navigation bar
   - Notes: Activates the rule for indexing operations

7. Verify the default query analysis rule is active
   - Element: **Check the default query analysis rule** (button) — in main content area
   - Notes: Confirm status via the displayed UI screenshot

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Rule Name | text_input | Yes | — | Unique name for the query analysis rule |
| Indexes | dropdown | Yes | — | Select one or more indexes to apply this rule |
| Analysis Type | radio | Yes | Word Weight | Type of analysis to perform on queries |

### Push Documents and Search

**Navigation**: Console > OpenSearch > Applications > Create Application

**Prerequisites**:
- AccessKey ID and AccessKey secret configured as environment variables
- OpenSearch application created in the console
- Endpoint URL obtained from application details page
- PHP environment with OpenSearch SDK installed

1. Navigate to the OpenSearch console and select your application
   - Element: **Applications** (menu) — in left navigation panel
   - Notes: Lists all your OpenSearch applications

2. View application details to find the API endpoint
   - Element: **Details** (link) — in main content area
   - Notes: The endpoint is required for client configuration

3. Configure environment variables for AccessKey credentials
   - Element: **Environment Variables** (tab) — in top-right corner
   - Notes: Must be set before running demo code

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Application Name | text | Yes | — | Name of the OpenSearch application for document operations |
| Table Name | text | Yes | — | Name of the table to push documents to |
| Query | text | Yes | — | Search query string to retrieve matching documents |
| Format | dropdown | No | fulljson, simplejson | Format of returned search results |

### Implement Dropdown Suggestions

**Navigation**: Console > Instances > Instance List > [Instance] > API Entrance > Public API

**Prerequisites**:
- OpenSearch instance created in the Alibaba Cloud console
- Access key ID and secret key configured as environment variables
- Java SDK version 4.0.0 or later (or earlier version for legacy code)

1. Go to the instance list page
   - Element: **instance list** (link) — in top navigation panel
   - Notes: Shows all your OpenSearch instances

2. Click the action button for your target instance
   - Element: **button** (button) — in actions column
   - Notes: Button label varies based on instance status and permissions

3. Find the public API endpoint in the API entrance section
   - Element: **Public API** (label) — in API Entrance section
   - Notes: Required for configuring your client

4. Navigate to the algorithm center to find suggestion model name
   - Element: **algorithm center** (menu) — in left navigation panel
   - Notes: Contains all algorithm-related configurations

5. Select Guide Search and click on drop-down suggestion
   - Element: **drop-down suggestion** (link) — in algorithm center submenu
   - Notes: Opens the suggestion configuration interface

### Configure Text Search

**Navigation**: Console > AI Search Open Platform > RAG > Experience Center

**Prerequisites**:
- AI Search Open Platform activated
- API key available for authentication

1. Log on to the AI Search Open Platform console
   - Element: **AI Search Open Platform** (link) — in top navigation
   - Notes: Primary entry point for AI search services

2. Select the China (Shanghai) region and choose the RAG service
   - Element: **RAG** (menu) — in top navigation
   - Notes: RAG stands for Retrieval-Augmented Generation

3. In the navigation pane, choose the Experience Center
   - Element: **Experience Center** (menu) — in left navigation panel
   - Notes: Provides interactive testing environment

4. For Service Type, select Text Embedding and choose vector service
   - Element: **Text Embedding** (dropdown) — in main content area
   - Notes: Enables text vectorization capabilities

5. Choose whether to vectorize documents or search queries
   - Element: **document** (radio) — in main content area
   - Notes: Use 'document' for knowledge base content, 'query' for search inputs

6. Click Get Results to generate a text embedding
   - Element: **Get Results** (button) — in top-right corner
   - Notes: Displays result, source code, and sample code upon success

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Service Type | dropdown | Yes | Text Embedding | Type of vectorization service to use |
| Input Type | radio | Yes | document, query | Specifies vectorization target type |

### Perform Fuzzy Search

**Navigation**: Console > OpenSearch > Applications > Create Application

**Prerequisites**:
- OpenSearch application with at least one field set to SHORT_TEXT type
- Analyzer for fuzzy searches assigned to that field during application creation

1. Navigate to the OpenSearch console and select Applications
   - Element: **Applications** (link) — in left navigation panel
   - Notes: Lists all your OpenSearch applications

2. Click Create Application to start setting up a new application
   - Element: **Create Application** (button) — in top-right corner
   - Notes: Opens the application creation wizard

3. In the field configuration section, set field type to SHORT_TEXT
   - Element: **Field Type** (dropdown) — in main content area
   - Notes: Only SHORT_TEXT fields support fuzzy searches

4. Assign an analyzer for fuzzy searches to the field
   - Element: **Analyzer** (dropdown) — in main content area
   - Notes: Ensure correct analyzer is selected for fuzzy matching

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Field Type | dropdown | Yes | TEXT, SHORT_TEXT, LONG_TEXT, NUMBER, DATE | Data type of the field; only SHORT_TEXT supports fuzzy searches |
| Analyzer | dropdown | Yes | Chinese Text Analyzer, General Purpose Chinese Text Analyzer, Fuzzy Search Analyzer, Default Analyzer | Defines text processing method; choose Fuzzy Search Analyzer for fuzzy matching |

## FAQ

Q: Where do I find the API endpoint for my OpenSearch application?
A: Navigate to Console > OpenSearch > Applications, select your application, and view the Details page where the endpoint is displayed in the Application Details section.

Q: What happens if I leave the Format field empty when configuring search?
A: The system will use the default format (typically JSON) for returning search results. For more detailed results including debugging information, specify "fulljson" explicitly.

Q: Can I modify query analysis rules after they've been created and set as default?
A: Yes, you can edit existing query analysis rules. However, changes may require re-indexing your data to take full effect, depending on the rule type and configuration.

Q: What permissions do I need to configure synonym rules in the console?
A: You need permissions to access the Search Algorithm Center and manage query analysis rules. Typically, this requires administrator or developer role permissions in your Alibaba Cloud account.

Q: How do I verify that my stop word filtering is working correctly?
A: Use the Query Test feature to run search queries containing stop words. The query analysis process should show these words being filtered out before the actual search execution.

## Pricing & Billing

### Billing Model
per_request

### Price Reference
| Tier | Input Price | Output Price |
|------|-------------|--------------|
| standard | 0.0005 / | 0.001 / |
| scroll_query | 0.0001 / | 0.0001 / |
| default | 0.0001 / | 0.0001 / |

### Free Tier

- 10,000 
- 100 tokens 

### Billing Notes