# es-search

Part of **ES**

# Elasticsearch Search Console Guide

## Operations Overview

| Operation | Console Entry | Prerequisites | Description |
|----------|---------------|---------------|-------------|
| Create OpenSearch Application | Console > OpenSearch > Applications > Create Application | Alibaba Cloud account with RAM user permissions | Creates a new search application and configures its schema |
| Download and Install PHP SDK | Console > OpenSearch > SDK Downloads | PHP 5.3+ installed, OpenSearch service access | Downloads the latest PHP SDK package for query and data push |
| Push Documents via Console | Console > OpenSearch > Apps > [App Name] > Data Management > Push Documents | Application created, schema configured | Uploads document data using the built-in push interface |
| View Application Basic Information | Console > OpenSearch > Applications > Basic Information | Application already created | Retrieves endpoint, app name, and other metadata for SDK configuration |
| Configure Scroll Queries for Large Data | Console > OpenSearch > Applications > Your Application > Data Processing > Scroll Queries | Application with at least one table, API endpoint | Sets up iterative scroll queries to process large result sets |

## Step-by-Step Instructions

### Create OpenSearch Application

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

**Prerequisites**:
- An Alibaba Cloud account with a RAM user granted the AliyunServiceRoleForOpenSearch role
- AccessKey ID and AccessKey secret for the RAM user

1. **Log on to the OpenSearch console**
   - Element: **Log on to the OpenSearch console** (link) — top-right corner

2. **Create an application**
   - Element: **Create Application** (button) — main content area
   - Notes: You will be guided through schema configuration after creation.

3. **Configure the application schema manually or via template**
   - Element: **Import Template** (button) — Configure Application page
   - Notes: Use this to upload a pre-defined schema file for testing or production.

4. **Download the OpenSearch SDK for your language**
   - Element: **Downloads** (link) — topic navigation
   - Notes: SDKs are required for programmatic interaction but can be accessed from the console.

### Download and Install PHP SDK

**Navigation**: Console > OpenSearch > SDK Downloads

**Prerequisites**:
- PHP 5.3 or later installed
- Access to OpenSearch service
- Understanding of OpenSearch API operations

1. **Navigate to the OpenSearch service**
   - Element: **OpenSearch** (menu) — left navigation panel

2. **Open the SDK Downloads section**
   - Element: **SDK Downloads** (link) — left navigation panel

3. **Select the desired SDK version**
   - Element: **V3.4.1 (2021-05-11)** (link) — main content area
   - Notes: The latest version is recommended for optimal performance and feature support.

4. **Download the SDK package**
   - Element: **php_v3.4.1.zip** (link) — main content area
   - Notes: Right-click and select "Save link as" to save the ZIP file locally.

### Push Documents via Console

**Navigation**: Console > OpenSearch > Apps > [App Name] > Data Management > Push Documents

**Prerequisites**:
- An OpenSearch app created in the console
- Application schema configured with index and attribute fields
- Network access to the OpenSearch endpoint

1. **Select your application**
   - Element: **Apps** (menu) — left navigation panel

2. **Go to Data Management**
   - Element: **Data Management** (tab) — top navigation bar

3. **Open the document push interface**
   - Element: **Push Documents** (button) — main content area
   - Notes: A form appears for entering or uploading document data.

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| App Name | dropdown | Yes | — | Select the target OpenSearch app where documents will be pushed. |
| Table Name | text_input | Yes | — | Specify the destination table within the app for the documents. |
| Document Data | textarea | Yes | — | Enter the document data in JSON format with fields like id, title, describe, and cmd. |
| Timestamp | checkbox | No | Use current time as timestamp | Enable this to set a custom timestamp for document ordering; otherwise, system time is used. |

### View Application Basic Information

**Navigation**: Console > OpenSearch > Applications > Basic Information

**Prerequisites**:
- An OpenSearch application already created

1. **Go to the Basic Information page**
   - Element: **Basic Information** (link) — Application details section

2. **Copy the endpoint and application name**
   - Element: **Endpoint** (text_input) — Endpoint and Application Name fields
   - Notes: These values are required when initializing SDK clients in your code.

### Configure Scroll Queries for Large Data

**Navigation**: Console > OpenSearch > Applications > Your Application > Data Processing > Scroll Queries

**Prerequisites**:
- An OpenSearch application with at least one table
- The endpoint of the OpenSearch API in your region
- An AccessKey pair (AccessKey ID and AccessKey secret) for authentication using a RAM user
- Required permissions granted to the AliyunServiceRoleForOpenSearch role

1. **Set environment variables for credentials**
   - Element: **Environment variables** (text_input) — Terminal or command prompt
   - Notes: Do not include your AccessKey pair in source code. Store credentials in environment variables instead.

2. **Replace placeholders in code with actual values**
   - Element: **Placeholder values** (text_input) — Java code editor
   - Notes: Replace `<your-app-name>`, `<your-table-name>`, and `<your-opensearch-api-endpoint>` with real values from the console.

3. **Run the scroll query program**
   - Element: **Run** (button) — IDE toolbar
   - Notes: Ensure the OpenSearch SDK for Java is properly configured in the project.

## FAQ

Q: Where do I find the API endpoint for my OpenSearch application?
A: Go to Console > OpenSearch > Applications > [Your App] > Basic Information. The endpoint is displayed in the "Endpoint" field.

Q: Can I modify the application schema after creation?
A: Yes, you can update certain aspects of the schema via the console, but structural changes like adding new index fields may require reindexing or creating a new application.

Q: What permissions does my RAM user need to use OpenSearch?
A: The RAM user must be granted the AliyunServiceRoleForOpenSearch role by your Alibaba Cloud account administrator.

Q: How do I enable debug tracing for SDK operations?
A: When initializing the SDK client, set the `debug` option to `true`. This will output trace information alongside search results for troubleshooting.

Q: Is there a limit to how many documents I can push in one request?
A: Yes, the maximum batch size is 1000 documents per push request. Exceeding this will result in a 400 Bad Request error.

## Pricing & Billing

### Billing Model
Billing is based on the number of search and management requests performed (per_request). Different operations (search, suggestion, application listing, document push) are billed separately.

### Price Reference

| Tier | Input Price | Output Price |
|------|-------------|--------------|
| default | 0.0001 / | 0.0002 / |
| standard | 0.0005 / | — |
| Standard Edition | 0.001 / | 0.002 / |
| Premium Edition | 0.003 / | 0.006 / |

### Free Tier
- Monthly free quota of 1000 requests for most operations
- Some editions offer up to 10,000 free requests per month

### Billing Notes
- Requests are billed based on actual usage; no charge if no requests are made
- Batch document pushes count as a single request
- Scroll queries and large result processing follow the same per-request billing model
- Free tier resets monthly