@@ -42,6 +42,24 @@ const getFiltersFromStorage = (datasetId: string) => {
42
42
return parsedFilters ;
43
43
} ;
44
44
45
+ const bm25Active = import . meta. env . VITE_BM25_ACTIVE as unknown as string ;
46
+
47
+ const default_settings = [
48
+ { name : "Hybrid" , route : "hybrid" } ,
49
+ {
50
+ name : "FullText" ,
51
+ route : "fulltext" ,
52
+ } ,
53
+ {
54
+ name : "Semantic" ,
55
+ route : "semantic" ,
56
+ } ,
57
+ ] ;
58
+
59
+ if ( bm25Active ) {
60
+ default_settings . push ( { name : "BM25" , route : "bm25" } ) ;
61
+ }
62
+
45
63
const MainLayout = ( props : LayoutProps ) => {
46
64
const apiHost = import . meta. env . VITE_API_HOST as unknown as string ;
47
65
@@ -72,6 +90,7 @@ const MainLayout = (props: LayoutProps) => {
72
90
const [ completionAbortController , setCompletionAbortController ] =
73
91
createSignal < AbortController > ( new AbortController ( ) ) ;
74
92
const [ showFilterModal , setShowFilterModal ] = createSignal < boolean > ( false ) ;
93
+ const [ searchType , setSearchType ] = createSignal < string | null > ( "hybrid" ) ;
75
94
76
95
const handleReader = async (
77
96
reader : ReadableStreamDefaultReader < Uint8Array > ,
@@ -201,6 +220,7 @@ const MainLayout = (props: LayoutProps) => {
201
220
llm_options : {
202
221
completion_first : streamCompletionsFirst ( ) ,
203
222
} ,
223
+ search_type : searchType ( ) ,
204
224
} ) ,
205
225
signal : completionAbortController ( ) . signal ,
206
226
} ) ;
@@ -460,6 +480,23 @@ const MainLayout = (props: LayoutProps) => {
460
480
} }
461
481
/>
462
482
</ div >
483
+ < div class = "flex w-full items-center gap-x-2" >
484
+ < label for = "search_option" > Search Type:</ label >
485
+ < select
486
+ id = "search_option"
487
+ class = "w-1/6 rounded-md border border-neutral-300 bg-neutral-100 p-1 dark:border-neutral-900 dark:bg-neutral-700"
488
+ value = { searchType ( ) ?? "" }
489
+ onChange = { ( e ) => {
490
+ setSearchType ( e . target . value ) ;
491
+ } }
492
+ >
493
+ < For each = { default_settings } >
494
+ { ( setting ) => (
495
+ < option value = { setting . route } > { setting . name } </ option >
496
+ ) }
497
+ </ For >
498
+ </ select >
499
+ </ div >
463
500
< div class = "flex w-full items-center gap-x-2" >
464
501
< label for = "system_prompt" > System Prompt:</ label >
465
502
< input
0 commit comments