All Products
Search
Document Center

OpenSearch:Custom parameters

Last Updated:Nov 28, 2024

This topic describes the custom parameters of OpenSearch LLM-Based Conversational Search Edition and syntax.

Q&A parameters

Parameters

Parameter

Type

Required

Valid value

Default value

Description

Select Model

String

Yes

N/A

opensearch-qwen

The large language model (LLM) used for this conversational search. For more information about the LLMs that are supported, see Manage LLMs.

Prompt

String

No

N/A

Default prompt template

The prompt template that is used for this conversational search. For more information about the prompt templates that are supported, see Manage prompts.

Multi-round Conversations

Boolean

No

N/A

true

  • false: disables the multi-round conversation feature.

  • true: enables the multi-round conversation feature. The system returns results based on the content of the previous N rounds of conversations.

  • session: specifies the source of the conversation. The system returns results based on the context of the conversations with the same source.

Streaming Output

Boolean

No

N/A

true

  • false: disables the streaming output feature.

  • true: enables the streaming output feature. The system returns results in real time.

Prompt parameters

Parameters

Parameter

Type

Required

Valid value

Default value

Description

attitude

String

No

N/A

normal

  • The tone of the conversation. Default value: normal. Valid values:

  • normal

  • polite

  • patience

rule

String

No

N/A

simple

The level of detail in the conversation. Default value: detailed. Valid values:

  • detailed

  • stepbystep

noanswer

String

No

N/A

sorry

The information that is returned if the system fails to provide an answer to the question. Default value: sorry. Valid values:

  • sorry

  • uncertain

language

String

No

N/A

Chinese

The language of the answer. Default value: Chinese. Valid values:

  • Chinese

  • English

  • Thai

  • Korean

role

Boolean

No

N/A

true

Specifies whether to enable a custom role to answer the question.

role_name

String

No

N/A

AI Assistant

The custom role. Example: AI Assistant.

out_format

String

No

N/A

text

The format of the answer. Default value: text. Valid values:

  • text

  • table

  • list

  • markdown

Document retrieval parameters

Parameters

Parameter

Type

Required

Valid value

Default value

Description

filter

String

No

N/A

None

The field that is used to filter documents. Example: filter = field = value.

top_n

Int

No

(0,50]

5

The number of documents to be retrieved.

sf

Float

No

[0,+∞)

1.3

The threshold that is used to determine the vector similarity of the documents to be retrieved.

  • When sparse vector is not enabled, the valid values range is [0,2.0] and the default value is 1.3. A smaller value leads to more relevant results, but the number of results may decrease.

  • When sparse vector is enabled, the default value is 0.35. A larger value results in more relevant retrieved results, but the number of results may decrease.

dense_weight

Float

(0,1)

0.7

The weight of the dense vector. This parameter is available if you select a sparse vector model. Valid values: (0,1). The weight of the sparse vector is calculated in the following way: 1 - Value of the dense_weight parameter.

formula

String

No

N/A

Vector similarity

The formula based on which the retrieved documents are sorted.

operator

String

No

N/A

AND

The operator between text tokens during text retrieval.

Syntax

Parameter

Description

filter

Format of a filter condition: field=value.

Examples

  1. Query data from the documents whose value of the category field is value1.

    "filter" : "category=\"value1\""

  2. Query data from the documents whose value of the category field is value1 or value2.

    "filter" : "category=\"value1\" OR category=\"value2\""

  3. Query data from the documents whose value of the category field is one of the specified values.

    Separate multiple values with commas (,).
    Example: category=value1,value2,value3,value4
    "filter" : "category=\"value1,value2,value3,value4\"" // Retrieve the documents whose value of the category field is one of the specified values.

top_n

top_n:value. Example: top_n:3. You can change the value of the top_n parameter based on your business requirements.

sf

sf=value. Example: sf=1.3. When sparse vector is not enabled, the valid values range is [0,2.0] and the default value is 1.3. A smaller value leads to more relevant results, but the number of results may decrease. When sparse vector is enabled, the default value is 0.35. A larger value results in more relevant retrieved results, but the number of results may decrease.

formula

  • Text relevance

  1. text_relevance: calculates the text relevance between search queries and field values in documents.

  2. field_match_ratio: returns the ratio of the number of terms in a field that match the search query to the total number of terms in the field.

  3. query_match_ratio: returns the ratio of the number of terms that are hit in a field to the total number of terms in the search query.

  4. fieldterm_proximity: returns the proximity of terms in a field.

  5. field_length: returns the number of terms in a field.

  6. query_term_count: returns the number of terms in the search query after analysis.

  7. query_term_match_count: returns the number of terms in the search query that are hit in a field in documents.

  8. field_term_match_count: returns the number of terms in a field that match the search query.

  9. query_min_slide_window: returns the ratio of the number of terms in the search query that are hit in a field to the minimum window of these terms in the field.

  • Timeliness

  1. timeliness: returns the timeliness score that indicates how new a document is in units of seconds.

  2. timeliness_ms: returns the timeliness score that indicates how new a document is in units of milliseconds.

  • Functionality

  1. tag_match: matches query clauses with documents based on tags and calculates the weights of matched tags to score the documents.

  2. first_phase_score: returns the score that is calculated by using rough sort expressions.

  3. kvpairs_value: returns the value of the specified field in a kvpairs clause in a query string.

  4. normalize: normalizes scores in different value ranges to numeric values in the range of [0,1].

  5. in or notin: checks whether field values are in or not in the specified list.

Reference image parameters

Parameters

Parameter

Type

Required

Valid value

Default value

Description

sf

Float

No

[0,+∞)

1

The threshold for determining the vector similarity of reference images. For sparse vector models, a greater value indicates a greater vector similarity. For dense vector models, a greater value indicates a smaller vector similarity.

dense_weight

Float

No

(0,1)

0.7

The weight of the dense vector. This parameter is available if you select a sparse vector model. Valid values: (0,1). The weight of the sparse vector is calculated in the following way: 1 - Value of the dense_weight parameter.

Syntax

Parameter

Description

sf

sf=value. Example: sf=1. You can change the value of the sf parameter based on your business requirements. Specify whether a sparse vector model is used.

Query understanding parameters

Parameters

Parameter

Type

Required

Valid value

Default value

Description

query_extend

Boolean

No

N/A

false

Specifies whether to extend queries. After this feature is enabled, queries are extended to improve the retrieval performance.

query_exten_num

Int

No

(0, +∞)

5

The number of queries to be extended.

Manual intervention parameter

Parameter

Parameter

Type

Required

Valid value

Default value

Description

sf

Float

No

[0,2]

0.3

The threshold for manual intervention. Default value: 0.3. A greater value indicates a match of intervention entries in an easier way.

Syntax

Parameter

Description

sf

sf=value. Example: sf=0.3. You can change the value of the sf parameter based on your business requirements. A greater value specifies that a manual intervention entry is more likely to be matched.

Other parameters

Parameters

Parameter

Type

Required

Valid value

Default value

Description

return_hits

Boolean

No

N/A

false

Specifies whether to return the search results. If you set this parameter to false, only reference links are returned.

csi_level

String

No

N/A

strict

The configurations for content moderation. Valid values:

  • none: does not moderate the content.

  • loose: moderates the results and blocks the results if restricted content is detected. In this case, no results are returned.

  • strict: moderates the results and blocks the results if restricted or suspicious content is detected. In this case, no results are returned.

history_max

INT

No

(0,20]

20

The maximum number of rounds of conversations based on which the system returns results. You can specify up to 20 rounds.

link

Boolean

No

N/A

false

Specifies whether to return the source of the retrieved document.

Syntax

Parameter

Description

return_hits

return_hits:value. Valid values: true and false. Example: return_hits:true. If you set the return_hits parameter to true, the corresponding search results are returned.

link

Sample response if you set this parameter to true:

You can resize the disk of an Elastic Compute Service (ECS) instance online or offline[^1^]. If you use the online resizing method, you can resize the disk without the need to restart the instance. If you use the offline resizing method, you must restart the instance[^1^]. To resize a disk, perform the following operations: Log on to the ECS console, find the disk that you want to resize, click Resize in the Actions column, and then select a resizing method based on your business requirements[^1^]. If you need to resize partitions and file systems, you can obtain relevant information by using the CLI or in the console[^2^]. After an ECS disk is resized, you can not reduce the capacity. We recommend that you implement reasonable capacity planning[^3^].

Note

[^Number^] indicates the ordinal number of the retrieved document in the reference of the returned results. For example, [^1^] indicates the first document in the reference.