# opensearch-algorithm

Part of **OPENSEARCH**

# OpenSearch Search Algorithm Console Guide

## Operations Overview

| Operation | Console Entry | Prerequisites | Description |
|----------|---------------|---------------|-------------|
| Create Tailored Retrieval Model | Console > Search Algorithm Center > Retrieval Configuration > Tailored Retrieval Models | Application must be in Advanced Edition, Dedicated application environment, Access to Search Algorithm Center | Create a custom retrieval model optimized for specific use cases using application data |
| Configure Custom Analyzer from Trained Model | Console > Search Algorithm Center > Analyzer Management > Text Analyzer | Trained tailored retrieval model, HA3 engine instance configured | Generate a custom analyzer based on a trained tailored retrieval model and apply it to an index |
| Add Intervention Dictionary Entry | Console > Search Algorithm Center > Retrieval Configuration > Dictionary Management | Tailored retrieval model created and trained | Define query-specific overrides that route queries to a specific tailored retrieval model |
| Evaluate Model Performance | Console > Search Algorithm Center > Retrieval Configuration > Tailored Retrieval Models > Test Effect | Trained tailored retrieval model | Test and compare term weight effects of one or two tailored retrieval models |

## Operation Steps

### Create Tailored Retrieval Model

**Navigation**: Console > Search Algorithm Center > Retrieval Configuration > Tailored Retrieval Models

**Prerequisites**:
- Application must be in Advanced Edition
- Dedicated application environment
- Text fields available for training
- HA3 engine instance configured

1. Navigate to the **Search Algorithm Center** menu  
   - Element: **Search Algorithm Center** (menu) — left-side navigation pane

2. Click **Retrieval Configuration**, then select **Tailored Retrieval Models**  
   - Element: **Tailored Retrieval Models** (menu) — left-side pane under Retrieval Configuration

3. Select your target application from the dropdown at the top of the page  
   - Element: **Select Application** (dropdown) — top of the page

4. Click the **Create** button to open the model creation panel  
   - Element: **Create** (button) — top-right corner of the page

5. Fill in the model configuration form:  
   - Element: **Model Name** (text_input) — enter a unique name (e.g., `ly_test`)  
   - Element: **Model Type** (dropdown) — choose either *Text Analyzer* or *Term Weight Analysis Model*  
   - Element: **Basic Analyzer** (dropdown) — select from options including:  
     - Chinese - General Analyzer  
     - Chinese - E-commerce Analyzer  
     - IT - Content Analyzer  
     - Industry - General Analyzer for Gaming  
     - Industry - Educational Q&A Search  
     - Industry - IT Content Analysis  
     - Industry - General Analyzer for E-commerce  
   - Element: **Training Fields** (dropdown) — select one or more TEXT or SHORT TEXT fields from your application  
   - Element: **Normalization** (checkbox) — optionally enable:  
     - Uppercase to Lowercase  
     - Traditional to Simplified Chinese  
     - Full-width to Half-width Characters  

6. Click **OK** to save the model configuration  
   - Element: **OK** (button) — bottom of the configuration panel  
   - Notes: The model is created in "Unavailable" state and requires training

7. Initiate model training  
   - Element: **Train** (button) — in the Actions column of the model row  
   - Notes: Training may take 1–2 days depending on data volume. Do not proceed until status changes to "Available"

| Parameter | Type | Required | Options/Values | Description |
|-----------|------|----------|----------------|-------------|
| Model Name | text_input | Yes | — | Unique name for the tailored retrieval model (e.g., `ly_test`) |
| Model Type | dropdown | Yes | Text Analyzer, Term Weight Analysis Model | Determines model behavior and downstream configuration |
| Basic Analyzer | dropdown | Yes | Chinese - General Analyzer, Chinese - E-commerce Analyzer, IT - Content Analyzer, Industry - General Analyzer for Gaming, Industry - Educational Q&A Search, Industry - IT Content Analysis, Industry - General Analyzer for E-commerce | Predefined domain-specific analyzer used as baseline |
| Training Fields | dropdown | Yes | [Application-specific TEXT fields] | Fields used to train the model; must be of TEXT or SHORT TEXT type |
| Normalization | checkbox | No | Uppercase to Lowercase, Traditional to Simplified Chinese, Full-width to Half-width Characters | Optional text normalization applied during search (does not alter original data) |

### Configure Custom Analyzer from Trained Model

**Navigation**: Console > Search Algorithm Center > Analyzer Management > Text Analyzer

**Prerequisites**:
- Tailored retrieval model has completed training (status = "Available")
- HA3 engine instance is configured for the application

1. In the left navigation pane, click **Analyzer Management**  
   - Element: **Analyzer Management** (tab) — left-side navigation pane

2. Switch to the **Text Analyzer** tab if not already selected  
   - Element: **Text Analyzer** (tab) — within Analyzer Management

3. Click **Create** to start defining a new analyzer  
   - Element: **Create** (button) — top-right corner of the Text Analyzer tab

4. Set **Analyzer Type** to **Tailored Model Analyzer**  
   - Element: **Tailored Model Analyzer** (dropdown) — analyzer type selection field

5. Select your HA3 engine instance and the trained tailored retrieval model  
   - Element: **Tailored Retrieval Model** (dropdown) — choose from available trained models  
   - Notes: Model version is auto-populated based on selection

6. Click **Save** to finalize the custom analyzer  
   - Element: **Save** (button) — bottom of the form

7. Apply the analyzer to your index schema:  
   - Navigate to the HA3 engine instance details page  
   - Click **Modify Offline Application**  
     - Element: **Modify Offline Application** (button) — on instance details page  
   - Go to **Configure Index Schema**  
   - For the target field, set **Analysis Method** to your new custom analyzer  
     - Element: **Analysis Method** (dropdown) — in index schema configuration section  
     - Notes: Select the specific model version to use

8. Wait for reindexing to complete before testing  
   - Notes: Reindexing is required for the new analyzer to take effect. Monitor progress in the offline application job queue.

### Add Intervention Dictionary Entry

**Navigation**: Console > Search Algorithm Center > Retrieval Configuration > Dictionary Management

**Prerequisites**:
- Tailored retrieval model created and trained

1. In the left navigation pane under Retrieval Configuration, click **Dictionary Management**  
   - Element: **Dictionary Management** (menu) — left-side pane

2. Click **Add Intervention Entry** to open the entry form  
   - Element: **Add Intervention Entry** (button) — top of the page

3. Fill in the intervention parameters:  
   - Element: **Query** (text_input) — enter the exact query string to override  
   - Element: **Analyzer** (dropdown) — select the base analyzer to use  
   - Element: **Tailored Retrieval Model** (dropdown) — choose the model to apply for this query  

4. Click **Save** to activate the intervention  
   - Element: **Save** (button) — bottom of the panel  
   - Notes: The intervention takes effect immediately for new queries matching the exact string

### Evaluate Model Performance

**Navigation**: Console > Search Algorithm Center > Retrieval Configuration > Tailored Retrieval Models > [Model Row] > Details

**Prerequisites**:
- At least one tailored retrieval model trained and available

1. On the **Tailored Retrieval Models** page, click **Details** for your model  
   - Element: **Details** (button) — in the Actions column

2. Scroll to the **Test Effect** section  
   - Notes: This section appears only after training completes

3. Enter a test query in the input field  
   - Element: **Test Text** (text_input) — in Test Effect section  
   - Notes: Query will be analyzed using the model to show term weights

4. (Optional) To compare two models, ensure both are trained, then:  
   - Click **Effect Comparison**  
     - Element: **Effect Comparison** (button) — top of Test Effect section  
   - Notes: Compares term weight outputs side-by-side for typical cases

## FAQ

Q: Where can I find the Tailored Retrieval Models feature in the console?
A: Navigate to Console > Search Algorithm Center > Retrieval Configuration > Tailored Retrieval Models. This feature is only available for Advanced Edition dedicated applications.

Q: Can I modify the training fields or analyzer after creating a tailored retrieval model?
A: No. Once a model is created, its configuration (including training fields and basic analyzer) cannot be changed. You must create a new model with updated settings.

Q: How long does model training typically take?
A: Training duration depends on your data volume and can take 1–2 days. The model status remains "Unavailable" during this period. Do not attempt to use it until status changes to "Available".

Q: What happens if I exceed the limit of 5 tailored retrieval models per instance?
A: The console will prevent you from creating additional models. You must delete an existing model before creating a new one.

Q: Do I need to reindex my data after applying a custom analyzer from a tailored model?
A: Yes. After assigning the custom analyzer to an index field via "Modify Offline Application", a full reindexing process is required before search results reflect the new model behavior.

## Pricing & Billing

### Billing Model
Charged based on storage capacity, computing resources, and model training. Tailored retrieval models are only available in the Advanced Edition of dedicated applications.

### Price Reference
- Advanced Edition: 0.02 / (per instance hour)

### Quota Limits
A maximum of 5 tailored retrieval models per instance

### Billing Notes
Elasticsearch engine instances do not support tailored retrieval models. This feature requires a HA3 engine instance in the Advanced Edition. Billing is tied to the underlying instance usage, not per model.