All Products
Search
Document Center

OpenSearch:Stop word intervention dictionaries

Last Updated:Apr 01, 2026

OpenSearch includes a built-in stop word dictionary that filters out common words during query processing. When the built-in dictionary misclassifies a word—either filtering a term that should match, or passing through a term that should be ignored—create an intervention dictionary to override the default behavior.

How it works

An intervention dictionary contains entries that each define a stop word and an intervention type:

Intervention typeEffect
AddMarks a word as a stop word. The word is excluded from retrieval.
BlockOverrides a built-in stop word. The word is included in retrieval.

When to use Add: A word appears in queries but never differentiates results. For example, in an e-commerce shopping guide app, the word "has" in the query "Hainan has bananas" is grammatical filler—adding it as a stop word ensures retrieval focuses on "Hainan" and "bananas".

When to use Block: A term in your domain matches a built-in stop word, but it carries real meaning. If a built-in stop word is filtered by default and returns results that ignore the term entirely, blocking it forces OpenSearch to include the term in retrieval so users get accurate results.

OpenSearch applies the built-in dictionary and your intervention entries together. When you enable stop word filtering in a query analysis rule, the built-in stop word dictionary is automatically selected alongside any intervention dictionaries you attach.

Note Intervention dictionaries are account-level resources. A single dictionary can be attached to multiple query analysis rules across different applications.

Prerequisites

Before you begin, ensure that you have:

  • An OpenSearch application with query analysis rules configured

  • Access to the OpenSearch console

Create an intervention dictionary

  1. In the OpenSearch console, go to Search Algorithm Center > Retrieval Configuration.

  2. On the Basic Configuration page, click Dictionary Management in the left pane.

  3. Click Create in the upper-left corner.

  4. Enter a name for the dictionary.

  5. Set Dictionary Type to Stop Word.

  6. Click Save.

The dictionary appears in the dictionary list.

Note The name and type of a dictionary cannot be changed after it is created.

Add intervention entries

  1. Find the dictionary in the list and click Manage Entries in the Actions column.

  2. Click Add Intervention Entry.

  3. In the Add Intervention Entries panel, enter the stop word in the Stop Word column.

  4. Select Add or Block in the Intervention Type column.

  5. Click Save.

Repeat for each word you want to intervene on. Each entry must use a unique stop word.

Entry constraints:

ConstraintValue
Stop words per entry1
Entries per dictionary500
NormalizationUppercase converted to lowercase; full-width characters converted to half-width
Note An entry takes effect only when a term in a segmented search query exactly matches the stop word. For example, if you add "what" as a stop word, the query "what facial cream is good" retrieves results based on "facial cream is good".

Apply the dictionary to a query analysis rule

  1. Go to the Query Analysis Rule Management page.

  2. Open an existing rule or create a new one.

  3. Associate the intervention dictionary with the rule.

  4. Save the rule without publishing it to the online application yet.

Note If an intervention dictionary is attached to a query analysis rule—whether applied to an online or offline application—you cannot delete the dictionary. Detach it from all rules before deleting.

Test and publish

Run a search test against the offline application before applying the rule to the online environment. Verify that the results reflect the expected stop word behavior.

For example, if you added "has" as a stop word, searching for "Hainan has bananas" should return all documents containing "Hainan bananas"—not just documents containing the exact phrase "Hainan has bananas".

After confirming the results, publish the rule to the online application.

Example

Scenario: An e-commerce shopping guide app returns few results when users search for "Hainan has bananas". The word "has" is not recognized as a stop word, so OpenSearch only retrieves documents containing the exact phrase.

Solution: Add "has" as a stop word in an intervention dictionary, then attach the dictionary to the query analysis rule used by the online application.

Procedure:

  1. Go to Search Algorithm Center > Retrieval Configuration > Dictionary Management and click Create.

    image

  2. Name the dictionary and set Dictionary Type to Stop Word.

    image

  3. Click Manage Entries for the new dictionary. In the Add Intervention Entries panel, set Stop Word to has and Intervention Type to Add, then click Save.

    image

  4. On the Query Analysis Rule Management page, click Create and attach the dictionary to the rule. Do not publish the rule yet.

    image

  5. Run a search test. Searching for "Hainan has bananas" now returns all documents containing "Hainan bananas".

  6. Publish the rule to the online application.

Limits and usage notes

ItemDetail
Intervention dictionaries per account20
Stop words per entry1 (each entry must use a unique stop word)
Entries per dictionary500
NormalizationUppercase converted to lowercase; full-width characters converted to half-width
Dictionary name and typeCannot be changed after creation
Shared dictionariesOne dictionary can be used by multiple query analysis rules
Built-in dictionaryWhen stop word filtering is enabled in a rule, the built-in stop word dictionary is automatically applied
Deleting a dictionaryCannot delete a dictionary attached to any query analysis rule (online or offline). Detach it from all rules first