Skip to content

Commit 5885979

Browse files
committed
feat(swift): searchWithRuleContextBuyer
1 parent 050684d commit 5885979

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import Foundation
2+
#if os(Linux) // For linux interop
3+
import FoundationNetworking
4+
#endif
5+
6+
import Core
7+
{{> snippets/import}}
8+
9+
func searchWithRuleContextBuyer() async throws {
10+
do {
11+
{{> snippets/init}}
12+
13+
// get the buyer account information
14+
let buyer = getBuyerAccountId();
15+
let searchParams = SearchSearchParams.searchSearchParamsObject(
16+
SearchSearchParamsObject(query: "<YOUR_SEARCH_QUERY>", ruleContexts: [buyer])
17+
)
18+
19+
let response: SearchResponse<Hit> = {{#dynamicSnippet}}searchWithSearchParams{{/dynamicSnippet}}
20+
print(response)
21+
} catch {
22+
print(error)
23+
}
24+
}

0 commit comments

Comments
 (0)