All Products
Search
Document Center

OpenSearch:Perform a Q&A test

Last Updated:Sep 23, 2026

The Q&A Test page in the OpenSearch LLM-Based Conversational Search Edition console verifies how your knowledge base answers questions. After you enter a question, the model matches relevant results and returns an answer. Set the parameters for your scenario and expected results, test Q&A outcomes, and then select the optimal parameter values.

Prerequisites

  • An OpenSearch LLM-Based Conversational Search Edition instance. For instructions, see Create an instance.

  • Data configuration completed for the instance. For instructions, see Configure data.

Procedure

This procedure uses a video file as an example. You upload the video to the knowledge base, wait for automatic parsing, and then run a Q&A test based on the video content to return relevant results.

Import the file into the knowledge base

Import the video file so that the knowledge base can parse its content.

  1. Log on to the OpenSearch console and select LLM-Based Conversational Search Edition.

  2. In the left-side navigation pane, click Instance Management.

  3. In the Actions column of the target instance, click Manage. The Instance Details page appears.

  4. Click Configuration Center and open Data Configuration.

  5. Click File Import and select the file to upload.

  6. Click Upload File. The file is imported into the knowledge base.

  7. Wait for the file upload to finish. Do not continue until the data query status is complete.

Run a Q&A test

After the file is parsed, ask the model a question and adjust the parameters until the answers match your expectations.

  1. In the left-side navigation pane, click Q&A Test.

  2. In the upper-right corner, click Model Configuration and set the parameters that your search scenario requires.

  3. Enter the question in the dialog box and click Send.

  4. View the Q&A test results. The model matches relevant results from the content in the uploaded knowledge base and returns an answer.

    Depending on the parameters that you set, the response can also include the retrieved documents (search_hits) and the sources of the referenced content.

Parameters

Configure the following parameters in Model Configuration on the Q&A Test page. The parameters are grouped by category.

Q&A parameters

ParameterTypeRequiredDefault valueValid valuesDescription
options.chat.modelStringYesopensearch-qwenSelects the large language model (LLM). The supported context length and the maximum input and output token counts vary by model.
PromptStringNoSystem default template-The prompt used for this search. For available prompts, see Available prompts.
question.sessionBooleanNotruetrue, false
  • false: Disables multi-turn conversations.

  • true: Enables multi-turn conversations and returns results based on the most recent n conversation rounds.

  • session: Identifies the conversation source. Conversations with the same source use their context to return results.

options.chat.enable_deep_searchBooleanNofalsetrue, false

Enables Deep search.

  • true: Enables deep search, which uses multi-round reasoning to consolidate data and return results. Each conversation consumes relatively more time and compute resources.

  • false: Disables deep search.

options.retrieve.web_search.enableBooleanNofalsetrue, false

Enables web search.

  • true: Enables web search and returns results based on web search data. Each conversation consumes relatively more time and compute resources.

  • false: Disables web search.

options.chat.streamBooleanNotruetrue, false

Enables streaming responses.

  • true: Returns responses as a stream.

  • false: Returns responses without streaming.

Prompt parameters

ParameterTypeRequiredDefault valueValid valuesDescription
options.chat.prompt_config.attitudeStringNonormalnormal, polite, patience

A parameter of the system-built template that controls the tone of the conversation.

  • normal: None.

  • polite: Uses a friendly and polite tone.

  • patience: Uses a tactful and patient tone.

options.chat.prompt_config.ruleStringNodetaileddetailed, stepbystep

The level of detail in the conversation.

  • detailed: Detailed and professional.

  • stepbystep: Detailed and step-by-step.

options.chat.prompt_config.noanswerStringNosorrysorry, uncertain

The response when a question cannot be answered.

  • sorry: Sorry, I cannot answer this question based on the available information.

  • uncertain: I do not know.

options.chat.prompt_config.languageStringNoChineseChinese, English, Thai, KoreanThe language used to answer questions.
options.chat.prompt_config.roleBooleanNo--Specifies whether to enable an answer role. When enabled, the answer role is customized.
options.chat.prompt_config.role_nameStringNo--The customized answer role. For example: AI Assistant.
options.chat.prompt_config.out_formatStringNotexttext, table, list, markdownThe format of the output content.

Document recall parameters

ParameterTypeRequiredDefault valueValid valuesDescription
options.retrieve.doc.filterStringNoEmpty-

When retrieving data that meets filter conditions from the knowledge base, explicitly specify the field and conditions. For filter examples, see Filter examples. Supported fields:

  • table: The table that contains the document.

  • raw_pk: The document primary key.

  • category: The document category.

  • score: The document score.

  • timestamp: The document timestamp.

options.retrieve.doc.top_nIntegerNo5(0, 50]The number of documents retrieved.
options.retrieve.doc.sfFloatNo1.3 when sparse vectors are disabled
0.35 when sparse vectors are enabled
[0, 2.0] when sparse vectors are disabled

Controls the vector-score threshold for document retrieval.

  • When sparse vectors are disabled, a smaller value makes results more relevant but returns fewer results. Conversely, less relevant documents might be retrieved.

  • When sparse vectors are enabled, a larger value makes results more relevant but returns fewer results. Conversely, the results might be less relevant.

options.retrieve.doc.dense_weightFloatNo0.7(0.0, 1.0)When sparse vectors are enabled, controls the weight of dense vectors during document retrieval.
options.retrieve.doc.formulaStringNo--Specifies the formula for ranking documents during retrieval. For the syntax, see Ranking formula syntax. The features Algorithm relevance and Geographical relevance are not supported.
options.retrieve.doc.operatorStringNoANDAND, OR

Specifies the relationship between terms after question.text is tokenized during knowledge base document retrieval. This parameter takes effect only when sparse vectors are not enabled.

  • AND: All terms must appear for a document to be retrieved.

  • OR: A document can be retrieved when any term appears.

The following examples show the format of options.retrieve.doc.filter:

"filter" : "raw_pk=\"123\""   # Retrieve data only from the document whose ID is 123
"filter" : "category=\"value1\""   # Retrieve data only from documents whose category is value1
"filter" : "category=\"value1\" OR category=\"value2\"" # Retrieve data only from documents whose category is value1 or value2
"filter" : "score>1.0"   # Retrieve data only from documents whose score is greater than 1.0
"filter" : "timestamp>1356969600"   # Retrieve data only from documents whose timestamp is later than 2013-1-1

Reference image parameters

ParameterTypeRequiredDefault valueValid valuesDescription
options.retrieve.image.sfFloatNo1 when sparse vectors are disabled
0.5 when sparse vectors are enabled
[0, 2.0] when sparse vectors are disabled

Controls the vector-score threshold for image retrieval.

  • When sparse vectors are disabled, a smaller value makes results more relevant but returns fewer results. Conversely, less relevant results might be retrieved.

  • When sparse vectors are enabled, a larger value makes results more relevant but returns fewer results. Conversely, the results might be less relevant.

options.retrieve.image.dense_weightFloatNo0.7(0.0, 1.0)When sparse vectors are enabled, controls the weight of dense vectors during image retrieval.

Query understanding parameters

ParameterTypeRequiredDefault valueValid valuesDescription
options.retrieve.qp.query_extendBooleanNofalsetrue, false

Specifies whether to expand the user query. Expanded queries are used to retrieve document chunks from the engine.

  • false: Consistent with the original behavior. The query is not expanded.

  • true: The model is called one more time, so responses are slower. Do not enable this option for latency-sensitive applications.

options.retrieve.qp.query_extend_numIntegerNo5(0,+∞)The maximum number of queries to expand when similar-query expansion is enabled.

Manual intervention parameters

ParameterTypeRequiredDefault valueValid valuesDescription
options.retrieve.entry.sfFloatNo0.3[0, 2.0]Controls the vector-score threshold for retrieval of manual intervention entries. A smaller value makes results more relevant but returns fewer results. Conversely, less relevant entries might be retrieved.

Deep search parameters

ParameterTypeRequiredDefault valueValid valuesDescription
options.chat.agent.think_processBooleanNo--Specifies whether to return the thinking process.
options.chat.agent.max_think_roundIntegerNo--The number of thinking rounds. The maximum value is 20.
options.chat.agent.languageStringNo-AUTO, CN, EN

The language for the thinking process and answers.

  • AUTO: Determines whether to use Chinese or English based on the user query.

  • CN: Chinese.

  • EN: English.

Other parameters

ParameterTypeRequiredDefault valueValid valuesDescription
options.retrieve.return_hitsBooleanNo--Specifies whether to return document retrieval results, which are search_hits in the response.
options.chat.history_maxIntegerNo1-The maximum number of multi-turn conversation history rounds. The maximum value is 20.
options.chat.linkBooleanNofalsetrue, false

Specifies whether to return links. Controls whether the content generated by the model identifies the sources of content references.

  • true: The content includes sources.

  • false: The content does not include sources.

options.chat.rich_text_strategyStringNoEmptyinside_response, extend_response

Specifies the post-processing method for rich-text LLM output. If this configuration does not exist or is empty, rich text is not enabled, which is the default behavior:

  • inside_response: Tags in the answer are directly restored to the original text in Markdown format. Tables are directly inserted into Markdown in HTML format.

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

options.retrieve.graphBooleanNo--Uses graph relationships for query association and retrieval. This parameter takes effect only after GraphRAG is enabled in data configuration.
options.chat.enable_llm_knowledgeBooleanNo-true, falseWhen enabled, the LLM provides a fallback answer if no search results are returned.

When options.chat.link is set to true, an example response that includes sources is as follows:

An ECS cloud disk can be expanded online or offline[^1^]. Online expansion does not require restarting the instance, whereas offline expansion does[^1^]. To expand the disk, select the disk to expand in the ECS console, choose Expand in the Actions column, and then select an expansion method as needed[^1^]. If partitions and file systems also need to be expanded, use the console or use the console[^2^]. After the disk capacity is expanded, the new capacity cannot be reduced after it takes effect. Plan storage space appropriately[^3^].

The number enclosed in [^ and ^] indicates the ordinal number of the document in the reference results. For example, [^1^] indicates the first document in reference.

Next steps

You can also call Q&A Test through the API and the SDK.