File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -39,15 +39,27 @@ async function atomicCoveo() {
3939 await searchInterface . initialize ( {
4040 accessToken : token ,
4141 organizationId : org_id ,
42- renewAccessToken : ( ) => { } ,
42+ preprocessRequest : ( request , clientOrigin , metadata ) => {
43+ const body = JSON . parse ( request . body ) ;
44+ body . q = `<@- ${ body . q } -@>` ;
45+ request . body = JSON . stringify ( body ) ;
46+
47+ return request ;
48+ } ,
4349 } ) ;
4450 searchInterface . executeFirstSearch ( ) ;
4551 }
4652
4753 await searchInterfaceStandalone . initialize ( {
4854 accessToken : token ,
4955 organizationId : org_id ,
50- renewAccessToken : ( ) => { } ,
56+ preprocessRequest : ( request , clientOrigin , metadata ) => {
57+ const body = JSON . parse ( request . body ) ;
58+ body . q = `<@- ${ body . q } -@>` ;
59+ request . body = JSON . stringify ( body ) ;
60+
61+ return request ;
62+ } ,
5163 } ) ;
5264 searchInterfaceStandalone . executeFirstSearch ( ) ;
5365}
You can’t perform that action at this time.
0 commit comments