All Products
Search
Document Center

OpenSearch:Q&A parameters

Last Updated:Oct 21, 2026

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

Q&A parameters

Parameters

Parameter

Type

Required

Valid values

Default value

Description

Model selection

String

Yes

-

opensearch-qwen

The large language model (LLM) used for the search. For information about the available models, see Manage LLMs.

Prompt

String

No

-

Default system template

The prompt used for the search. For information about the available prompts, see Prompt management

Multi-round conversation

Boolean

No

-

true

  • false: Multi-round conversation is disabled.

  • true: Multi-round conversation is enabled. Results are returned based on the content of the most recent n rounds of conversation.

  • session: Identifies the source of a conversation. Conversations from the same source are conducted based on the context.

Streaming output

Boolean

No

-

true

  • false: Streaming output is disabled.

  • true: Streaming output is enabled. The answers of the model are output in real time.

Prompt parameters

Parameters

Parameter

Type

Required

Valid values

Default value

Description

attitude

String

No

-

normal

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

  • normal: none

  • polite: uses a kind and polite tone

  • patience: uses a tactful and patient tone

rule

String

No

-

detailed

The level of detail of the conversation. Default value: detailed.

  • detailed: detailed and professional

  • stepbystep: detailed and step-by-step

noanswer

String

No

-

sorry

The reply returned when a question cannot be answered. Default value: sorry.

  • sorry: Sorry, this question cannot be answered based on the known information.

  • uncertain: I don't know.

language

String

No

-

Chinese

The language used to answer questions. Default value: Chinese.

  • Chinese: Chinese

  • English: English

  • Thai: Thai

  • Korean: Korean

role

Boolean

No

-

true

If enabled, the role used for answers is customized.

role_name

String

No

-

AI Assistant

The customized role used for answers. Example: AI Assistant.

out_format

String

No

-

text

The format of the output content. Default value: text.

  • text: text

  • table: table

  • list: list

  • markdown: markdown

Document retrieval parameters

Parameters

Parameter

Type

Required

Valid values

Default value

Description

filter

String

No

-

-

Filters documents based on the target field during retrieval. Example: filter = field = value

top_n

Int

No

(0, 50]

5

The number of documents to retrieve.

sf

Float

No

[0,+∞)

1.3

The threshold of the vector score for vector-based retrieval.

  • If sparse vectors are not enabled, the valid values are [0, 2.0] and the default value is 1.3. A smaller value returns more relevant results but fewer results. A larger value may return less relevant results.

  • If sparse vectors are enabled, the default value is 0.35. A larger value returns more relevant results but fewer results. A smaller value may return less relevant results.

dense_weight

Float

(0,1)

0.7

Optional when a sparse vector model is selected. The weight of dense vectors. The value is a floating-point number in the range of (0,1). The weight of sparse vectors is 1 - dense_weight.

formula

String

No

-

Vector similarity

The sort expression for document retrieval.

operator

String

No

-

AND

The relationship between text tokens during text-based retrieval.

Syntax

Parameter

Syntax

filter

Filter condition format: field=value

Examples:

  1. Obtain data only from documents whose category is value1.

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

  2. Obtain data only from documents whose category is value1 or value2.

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

  3. Multi-value filtering on category

    When you pass multiple values for the category field, separate the items with commas (,).
    eg: category =  Category1,Category2,Category3,Category4
    "filter" : "category=\"Category1\""  //The value of category can be any item among the passed values

top_n

top_n:value eg: top_n = 3 You can adjust the value of the top_n parameter based on your business requirements.

sf

sf=value eg:sf = 1.3 If sparse vectors are not enabled, the valid values are [0, 2.0] and the default value is 1.3. A smaller value returns more relevant results but fewer results. A larger value may return less relevant results. If sparse vectors are enabled, the default value is 0.35. A larger value returns more relevant results but fewer results. A smaller value may return less relevant results.

formula

  • Text relevance

  1. text_relevance: the degree of text matching between the keyword and the field

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

  3. query_match_ratio: obtains the ratio of the number of query terms that are hit (in a field) to the total number of query terms

  4. fieldterm_proximity: indicates how closely the terms of the keyword appear together in the field

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

  6. query_term_count: returns the number of terms after the query is tokenized

  7. query_term_match_count: obtains the number of query terms that hit the document (in a field)

  8. field_term_match_count: obtains the number of terms in a field of the document that match the query terms

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

  • Timeliness

  1. timeliness: the timeliness score, which measures how recent a document is. Unit: seconds.

  2. timeliness_ms: the timeliness score, which measures how recent a document is. Unit: milliseconds.

  • Functionality

  1. tag_match: matches tags between the query and documents, and uses the matching results to weight document scores

  2. first_phase_score: obtains the final score calculated by the rough sort expression

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

  4. normalize: a normalization function that normalizes values to [0, 1] based on different scores

  5. in and notin: determines whether a field value is (or is not) in the specified list

Reference image parameters

Parameters

Parameter

Type

Required

Valid values

Default value

Description

sf

Float

No

[0,+∞)

1

The threshold for reference images. For sparse vector models, a larger sf value indicates a higher vector similarity between the reference images and the content. For dense vector models, a larger sf value indicates a lower vector similarity between the reference images and the content.

dense_weight

Float

No

(0,1)

0.7

Optional when a sparse vector model is selected. The weight of dense vectors. The value is a floating-point number in the range of (0,1). The weight of sparse vectors is 1 - dense_weight.

Syntax

Parameter

Syntax

sf

sf=value eg:sf = 1 You can adjust the value of the sf parameter as expected. Take into account whether a sparse vector model is used.

Query understanding parameters

Parameters

Parameter

Type

Required

Valid values

Default value

Description

query_extend

Boolean

No

-

false

If enabled, queries are expanded to improve retrieval quality.

query_exten_num

Int

No

(0,+∞)

5

The number of expanded queries.

Manual intervention parameters

Manual intervention parameters

Parameter

Type

Required

Valid values

Default value

Description

sf

Float

No

[0,2]

0.3

The threshold for manual intervention questions. Default value: 0.3. A larger sf value makes it easier to match manual intervention entries.

Syntax

Parameter

Syntax

sf

sf=value eg:sf = 0.3 You can adjust the value of the sf parameter as expected. A larger sf value makes it easier to match manual intervention entries.

Other parameters

Other parameters

Parameter

Type

Required

Valid values

Default value

Description

return_hits

Boolean

No

-

false

Specifies whether to return the document retrieval results in the response. If the results are not returned, only reference links are returned.

csi_level

String

No

-

strict

Content Moderation configuration

  • none: Content does not need to be processed by Content Moderation.

  • loose: Content must be processed by Content Moderation. Content is blocked and no results are returned only if Content Moderation determines that sensitive content definitely exists.

  • strict: Content must be processed by Content Moderation. Content is blocked and no results are returned if Content Moderation determines that sensitive content exists or is suspected to exist.

history_max

INT

No

(0,20]

20

The maximum number of history rounds for multi-round conversations. Maximum value: 20.

link

Boolean

No

-

false

Specifies whether to return the specific sources of the retrieved documents in the response.

rich_text_strategy

String

No

-

The post-processing method for rich-text LLM output (if this configuration does not exist or is empty, rich text is disabled, which is the default behavior):

  • inside_response: The tags in the answer are restored directly into the original text in Markdown format (note that tables are inserted into the Markdown directly as HTML).

  • extend_response: The answer contains rich-text tags, and the actual content of each tag is returned separately in rich_text_ref: image content as URLs, table content in HTML format, and code in text format.

Syntax

Parameter

Syntax

return_hits

return_hits:false eg:return_hits = true Returns the corresponding search results.

link

The following example shows a response that contains content:

You can expand the capacity of an ECS cloud disk by using online expansion or offline expansion[^1^]. Online expansion does not require an instance restart, whereas offline expansion requires an instance restart[^1^]. To perform the expansion, select the cloud disk that you want to expand in the ECS console, choose Resize in the Actions column, and then select an expansion method as needed[^1^]. If you need to extend partitions and file systems, you can obtain the information by using the command line or the console[^2^]. After the expanded capacity of a cloud disk takes effect, the capacity cannot be reduced. We recommend that you plan your storage space properly[^3^].
Note

A number enclosed in '[^' and '^]' indicates the position of the document in reference in the returned results. For example, '[^1^]' refers to the first document in reference.