We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7402f8c commit 387310dCopy full SHA for 387310d
templates/kotlin/guides/search/setSettingsThenSaveObjects.mustache
@@ -0,0 +1,20 @@
1
+{{> snippets/import}}
2
+import com.algolia.client.model.search.*
3
+
4
+suspend fun setSettingsThenSaveObjects() {
5
+ playlists.forEach { playlist ->
6
+ // Fetch from your own data storage and with your own code
7
+ // the associated application ID and API key for this user
8
+ val appID = getAppIDFor(playlist["user"].toString());
9
+ val apiKey = getIndexingApiKeyFor(playlist["user"].toString());
10
11
+ val client = SearchClient(appID, apiKey)
12
+ val settings = IndexSettings(
13
+ attributesForFaceting = listOf("filterOnly(user)")
14
+ )
15
16
+ client.{{#dynamicSnippet}}setSettings{{/dynamicSnippet}}
17
18
+ client.{{#dynamicSnippet}}saveObjectsPlaylists{{/dynamicSnippet}}
19
+ }
20
+}
0 commit comments