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() {
39
39
await searchInterface . initialize ( {
40
40
accessToken : token ,
41
41
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
+ } ,
43
49
} ) ;
44
50
searchInterface . executeFirstSearch ( ) ;
45
51
}
46
52
47
53
await searchInterfaceStandalone . initialize ( {
48
54
accessToken : token ,
49
55
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
+ } ,
51
63
} ) ;
52
64
searchInterfaceStandalone . executeFirstSearch ( ) ;
53
65
}
You can’t perform that action at this time.
0 commit comments