Stop words

更新时间:
复制 MD 格式

Overview

The system filters meaningless words from a search query by using a built-in stop word dictionary. These words are typically high-frequency words that do not affect the search results, such as punctuation marks and modal particles. For example, for the search query "Run! Brothers", the punctuation mark "!" is not used for retrieval. For the query "Have you eaten?", the question mark "?" and modal particles are not used for retrieval.

Procedure

1. Log on to the OpenSearch console. In the left-side navigation pane, under retrieval configuration, click query analysis rule configuration. Select the target application and its type (online or offline), and then click Create.

2. Specify the rule name, index range, and industry type. For the feature selection, select stop word, and then click OK.

Note: If you do not specify an intervention dictionary, the default dictionary is used. If you encounter incorrect results, you can configure an intervention dictionary as described in the "Intervention dictionary for stop word filtering" section of this topic.

3. After you create the rule, click Search Test to test its effect.

Test result: On the search test page, select the corresponding application and online application type, enter default:'Hebei Province' in the search box, and in the parameters section, set qp to the query analysis rule that you created (such as test_ting). After you click Search, the information bar on the page displays the actual search query as (default:'Hebei'), which indicates that the stop word "Province" was successfully filtered and one matching result is returned.

The query analysis process shows that the original search query Hebei Province remains Hebei Province after normalization, the tokenization result is Hebei/Province, stop word filtering removes Province, and the final rewritten query is (default:'Hebei').

4. After you confirm that the rule works correctly, return to the query analysis rule configuration page and switch to the index view tab. To make the rule the default, click set as default.

5. The interface updates after you set a default query analysis rule.

A [Default] tag appears before the rule name, indicating it is the default query analysis rule.

Stop word intervention dictionary

Different business scenarios require different sets of stop words. The system's built-in dictionary might not cover all your needs or could contain words you want to include in searches. To address this, OpenSearch provides an intervention feature that lets you customize stop words. You can create an intervention dictionary for stop word filtering and apply it to your query analysis rule to override the default behavior. For detailed instructions on how to configure an intervention dictionary, click here.