Skip to content

Commit

Permalink
feat(dart): searchWithRuleContexts (+ local vars)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fluf22 committed Jan 24, 2025
1 parent 042d8c8 commit 4020690
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
17 changes: 17 additions & 0 deletions templates/dart/guides/search/searchWithRuleContexts.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{> snippets/import}}

String getPlatformTag() {
return ""; // Implement your logic here
}

void searchWithRuleContexts() async {
{{> snippets/init}}

final platformTag = getPlatformTag();
final searchParams = SearchParamsObject(
query: "<YOUR_SEARCH_QUERY>",
ruleContexts: [platformTag]
);

await {{#dynamicSnippet}}searchWithSearchParams{{/dynamicSnippet}};
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{{> snippets/import}}
import com.algolia.client.model.search.*

val getPlatformTag: () -> String = {
"" // Implement your logic here
}

suspend fun searchWithRuleContexts() {
{{> snippets/init}}

Expand Down
4 changes: 4 additions & 0 deletions templates/scala/guides/search/searchWithRuleContexts.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import scala.concurrent.ExecutionContext.Implicits.global
{{> snippets/import}}
import algoliasearch.search.SearchParamsObject

val getPlatformTag: String = {
"" // Implement your logic here
}

def searchWithRuleContexts(): Future[Unit] = {
{{> snippets/init}}

Expand Down
2 changes: 2 additions & 0 deletions templates/swift/guides/search/searchWithRuleContexts.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import Foundation
import Core
{{> snippets/import}}

let getPlatformTag = {""} // Implement your logic here

func searchWithRuleContexts() async throws {
do {
{{> snippets/init}}
Expand Down

0 comments on commit 4020690

Please sign in to comment.