All Products
Search
Document Center

OpenSearch:Term weight analysis

Last Updated:Mar 06, 2023

Overview

The term weight analysis feature evaluates the importance of each term in search queries and quantifies the evaluated importance as a weight. OpenSearch may not use low-importance terms to retrieve documents. This helps increase the number of documents that are retrieved. If the search queries that you entered contain low-importance terms and these terms are involved in the document retrieval process, only a small number of documents may be retrieved based on the search queries.

For example, you enter the following search query: opensearch good or not.

The original query clause is query=default:'opensearch' AND default:'good or not' before it is rewritten by the term weight analysis feature.

After the original query clause is rewritten by the term weight analysis feature, the new query clause becomes query=default:'opensearch' RANK default:'good or not'.

Then, OpenSearch retrieves all documents that contain the term opensearch.

Procedure

1. Log on to the OpenSearch console. In the left-side navigation pane, click Retrieval Configuration. On the Basic Configuration page, click Query Analysis Rule Configuration in the left-side pane. On the Query Analysis Rule Configuration page, select an application and the online or offline version of the application, and click Create.

image

2. In the Create Rule panel, enter a rule name, specify an index range, select an industry type, select Term Weight, and then click OK.

image

3. After the rule is created, run a search test.

imageThe following figure shows the search results.

The following figure shows how to view the process of query analysis.

image

4. After you confirm that the process of query analysis is correct, click Index Orientation on the Query Analysis Rule Configuration page. Then, specify the created query analysis rule as the default query analysis rule.

image

5. Check the default query analysis rule.

image

Intervention dictionaries for term weight analysis

The terms that are extracted from the same search query after query analysis may be of different weights in different business scenarios. The settings of term weights in the built-in dictionary may not meet your requirements. To resolve the issue, OpenSearch allows you to customize term weights. After you create an intervention dictionary for term weight analysis, you can specify the intervention dictionary when you create or modify a query analysis rule. This way, you can intervene in the analysis of term weights. For more information, see Intervention dictionaries for term weight analysis.