Skip to content

Commit 4020690

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

File tree

4 files changed

+27
-0
lines changed

4 files changed

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

templates/kotlin/guides/search/searchWithRuleContexts.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 getPlatformTag: () -> String = {
5+
"" // Implement your logic here
6+
}
7+
48
suspend fun searchWithRuleContexts() {
59
{{> snippets/init}}
610

templates/scala/guides/search/searchWithRuleContexts.mustache

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ import scala.concurrent.ExecutionContext.Implicits.global
44
{{> snippets/import}}
55
import algoliasearch.search.SearchParamsObject
66

7+
val getPlatformTag: String = {
8+
"" // Implement your logic here
9+
}
10+
711
def searchWithRuleContexts(): Future[Unit] = {
812
{{> snippets/init}}
913

templates/swift/guides/search/searchWithRuleContexts.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 getPlatformTag = {""} // Implement your logic here
10+
911
func searchWithRuleContexts() async throws {
1012
do {
1113
{{> snippets/init}}

0 commit comments

Comments
 (0)