Skip to content

Commit 042d8c8

Browse files
committed
feat(dart): searchWithRuleContextBuyer (+ local vars)
1 parent d91adf5 commit 042d8c8

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{{> snippets/import}}
2+
3+
String getBuyerAccountId() {
4+
return ""; // Implement your logic here
5+
}
6+
7+
void searchWithRuleContextBuyer() async {
8+
{{> snippets/init}}
9+
10+
// get the buyer account information
11+
final buyer = getBuyerAccountId();
12+
final searchParams = SearchParamsObject(query: "<YOUR_SEARCH_QUERY>", ruleContexts: [buyer]);
13+
14+
await {{#dynamicSnippet}}searchWithSearchParams{{/dynamicSnippet}};
15+
}

templates/kotlin/guides/search/searchWithRuleContextBuyer.mustache

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{{> snippets/import}}
22
import com.algolia.client.model.search.*
33

4+
val getBuyerAccountId: () -> String = {
5+
"" // Implement your logic here
6+
}
7+
48
suspend fun searchWithRuleContextBuyer() {
59
{{> snippets/init}}
610

templates/scala/guides/search/searchWithRuleContextBuyer.mustache

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ import scala.concurrent.duration.Duration
66
{{> snippets/import}}
77
import algoliasearch.search.SearchParamsObject
88

9+
val getBuyerAccountId: () => String = () => {
10+
"" // Implement your logic here
11+
}
12+
913
def searchWithRuleContextBuyer(): Future[Unit] = {
1014
{{> snippets/init}}
1115

templates/swift/guides/search/searchWithRuleContextBuyer.mustache

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import Foundation
66
import Core
77
{{> snippets/import}}
88

9+
let getBuyerAccountId = {""} // Implement your logic here
10+
911
func searchWithRuleContextBuyer() async throws {
1012
do {
1113
{{> snippets/init}}

0 commit comments

Comments
 (0)