OpenSearch LLM-Based Conversational Search Edition supports extended parameters that control how the large language model (LLM) generates answers, how documents are retrieved and ranked, and how results are filtered and returned.
Prompt parameters
These parameters shape the tone, format, and language of LLM-generated answers.
attitude
The tone of the answer. Default value: normal. Valid values: normal, polite, patience.
rule
The level of detail in the answer. Default value: detailed.
| Value | Behavior |
|---|---|
detailed (default) | Detailed and professional answer |
stepbystep | Detailed answer with step-by-step instructions |
noanswer
The fallback response when the system cannot answer based on available information. Default value: sorry.
| Value | Response text |
|---|---|
sorry (default) | "Sorry, I cannot answer your question based on known information." |
uncertain | "I do not know." |
language
The language of the generated answer. Default value: Chinese.
| Value | Language |
|---|---|
Chinese (default) | Chinese |
English | English |
Thai | Thai |
Korean | Korean |
role
A custom persona for the answering agent. Example: AI assistant.
out_format
The format of the generated answer. Default value: text.
| Value | Output format |
|---|---|
text (default) | Plain text |
table | Table |
list | List |
markdown | Markdown |
Document retrieval parameters
These parameters control which documents are retrieved and how they are ranked before the LLM generates an answer.
filter
Filters the document pool by field value before retrieval. By default, no filter is applied.
Syntax: field=value
Examples:
Match a single value:
"filter": "category=\"value1\""Match one of two values using OR:
"filter": "category=\"value1\" OR category=\"value2\""Match any value in a comma-separated list:
"filter": "category=\"value1,value2,value3,value4\""sf
The similarity threshold for vector-based retrieval. Documents with a score above this threshold are considered less relevant and may be excluded.
Default:
1.3Valid values:
[0, +∞)Syntax:
sf=value— for example,sf=1
A lower value requires higher similarity; a higher value allows more loosely related documents. Decrease sf to tighten relevance requirements, or increase it to retrieve a broader set of documents.
The sf parameter also appears under Manual intervention parameters and Reference image parameters, each with a different default value and semantic meaning. These are independent configurations.top_n
The maximum number of documents to retrieve per query.
Default:
5Valid values:
(0, 50]Syntax:
top_n:value— for example,top_n:3
Increasing top_n gives the LLM more context for complex questions, but also increases response latency. Decrease it to speed up responses when fewer reference documents are sufficient.
formula
The scoring formula used to rank retrieved documents. Combine multiple functions using standard arithmetic operators.
Text relevance
| Function | Description |
|---|---|
text_relevance | Calculates text relevance between the search query and field values |
field_match_ratio | Ratio of matched terms in a field to total terms in the field |
query_match_ratio | Ratio of query terms matched in a field to total query terms |
fieldterm_proximity | Proximity of matched terms within a field |
field_length | Number of terms in a field |
query_term_count | Number of terms in the search query after analysis |
query_term_match_count | Number of query terms matched in a field |
field_term_match_count | Number of field terms that match the search query |
query_min_slide_window | Ratio of matched query terms to the minimum window of those terms in the field |
Timeliness
| Function | Description |
|---|---|
timeliness | Freshness score for a document. Unit: seconds |
timeliness_ms | Freshness score for a document. Unit: milliseconds |
Functionality
| Function | Description |
|---|---|
tag_match | Scores documents by matching query clauses against tags and computing tag weights |
first_phase_score | Score from the rough-sort (first-phase) expressions |
kvpairs_value | Value of a specified field in a kvpairs clause of the query string |
normalize | Normalizes scores from different value ranges to [0, 1] |
in or notin | Checks whether field values are in or not in a specified list |
operator
The logical operator used to combine tokens during retrieval. Default value: AND.
| Value | Behavior |
|---|---|
AND (default) | Retrieves only documents that contain all query tokens |
OR | Retrieves documents that contain any query token; increases recall at the cost of precision |
Manual intervention parameters
sf
The similarity threshold for triggering a manual intervention entry. A higher value makes it easier for an entry to match.
Default:
0.3Valid values:
[0, +∞)Syntax:
sf=value— for example,sf=1
Reference image parameters
sf
The vector similarity threshold between a reference image and the specified content. A higher value allows less similar images to match.
Default:
1Valid values:
[0, +∞)Syntax:
sf=value— for example,sf=1
Other parameters
return_hits
Specifies whether to include search results in the response.
| Value | Behavior |
|---|---|
false (default) | Returns only reference links |
true | Returns the corresponding search results |
Syntax: return_hits:value — for example, return_hits:true
csi_level
Enables content moderation on LLM-generated results. When moderation is triggered, no results are returned.
| Value | Behavior |
|---|---|
none | No moderation applied |
loose | Blocks results if restricted content (sensitive, political, or harmful) is detected |
strict | Blocks results if restricted or suspicious content is detected — a stricter interpretation of the boundary than loose |
link
Specifies whether the reference source is included in the LLM-generated answer. When set to true, citations appear as inline footnote markers ([^1^], [^2^], ...) where the number corresponds to the ordinal position of the referenced document in the returned results.
| Value | Behavior |
|---|---|
true | Reference sources are embedded in the generated answer as footnote markers |
false | Reference sources are not included in the generated answer |
Sample response with `link: 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 steps: 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 cannot reduce the capacity. We recommend that you implement reasonable capacity planning[^3^].[^Number^] indicates the ordinal number of the retrieved document in the reference. For example, [^1^] refers to the first document.