From 40b48510f4da8142c561263d28fdf2ffa6f0f4bb Mon Sep 17 00:00:00 2001 From: Joel Date: Wed, 17 Apr 2024 17:40:28 +0800 Subject: [PATCH] feat: economical index support retrieval testing (#3563) --- .../datasets/hit-testing/textarea.tsx | 40 ++++++++++--------- web/types/app.ts | 1 + 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/web/app/components/datasets/hit-testing/textarea.tsx b/web/app/components/datasets/hit-testing/textarea.tsx index fb2cb90313..17a8694de1 100644 --- a/web/app/components/datasets/hit-testing/textarea.tsx +++ b/web/app/components/datasets/hit-testing/textarea.tsx @@ -49,7 +49,14 @@ const TextAreaWithButton = ({ const onSubmit = async () => { setLoading(true) const [e, res] = await asyncRunSafe( - hitTesting({ datasetId, queryText: text, retrieval_model: retrievalConfig }) as Promise, + hitTesting({ + datasetId, + queryText: text, + retrieval_model: { + ...retrievalConfig, + search_method: isEconomy ? RETRIEVE_METHOD.keywordSearch : retrievalConfig.search_method, + }, + }) as Promise, ) if (!e) { setHitResult(res) @@ -102,7 +109,7 @@ const TextAreaWithButton = ({ {text?.length} / - 200 + 200 @@ -114,25 +121,20 @@ const TextAreaWithButton = ({ > {text?.length} / - 200 + 200 )} - -
- -
-
+ +
+ +
diff --git a/web/types/app.ts b/web/types/app.ts index e2ee0cc5ff..14c20fd8f9 100644 --- a/web/types/app.ts +++ b/web/types/app.ts @@ -33,6 +33,7 @@ export enum RETRIEVE_METHOD { fullText = 'full_text_search', hybrid = 'hybrid_search', invertedIndex = 'invertedIndex', + keywordSearch = 'keyword_search', } export type VariableInput = {