You're viewing an archived version of our docs. Check out our current documentation →

Upgrade the Scala API clients to v2

The latest major version of the algoliasearch-scala package is v2. This page lists the breaking changes since the last release, v1.

Method changes overview

The following table has links for all methods and their replacements

Search API client

v1 (legacy) v2 (latest)
add key → client.addApiKey
assign UserID → client.assignUserId
not available → client.batchAssignUserIds
clear dictionary → client.batchDictionaryEntries
copy index → client.operationIndex
not available → client.operationIndex
not available → client.operationIndex
delete key → client.deleteApiKey
delete dictionary → client.batchDictionaryEntries
get key → client.getApiKey
getTopUserIDs → client.getTopUserIds
getUserID → client.getUserId
list keys → client.listApiKeys
list indices → client.listIndices
listUserIDs → client.listUserIds
move index → client.operationIndex
multipleBatch → client.multipleBatch
multiQueries → client.search
remove userID → client.removeUserId
replace dictionary → client.batchDictionaryEntries
restore key → client.restoreApiKey
save dictionary → client.batchDictionaryEntries
searchUserIDs → client.searchUserIds
update key → client.updateApiKey
index.batch → client.batch
clear index → client.clearObjects
clear rules → client.clearRules
clear synonyms → client.clearSynonyms
not available → client.operationIndex
delete → client.deleteIndex
delete by → client.deleteBy
deleteObject → client.deleteObject
delete objectIds → client.deleteObjects
delete rule → client.deleteRule
delete synonym → client.deleteSynonym
helper.findObject → client.searchSingleIndex
getObject → client.getObject
get objectIds → client.getObjects
get rule → client.getRule
settings of → client.getSettings
get synonym → client.getSynonym
index.getTask → client.getTask
partialUpdateObject → client.partialUpdateObject
partialUpdate objects → client.partialUpdateObjects
not available → client.replaceAllObjects
not available → client.saveRules
not available → client.saveSynonyms
saveObject → client.saveObject
index objects → client.saveObjects
save rule → client.saveRule
saveRules → client.saveRules
save synonym → client.saveSynonym
save synonyms → client.saveSynonyms
search → client.searchSingleIndex
search facet → client.searchForFacetValues
search rules → client.searchRules
search synonyms → client.searchSynonyms
setSettings of → client.setSettings
{operation}.wait → client.waitForTask

Recommend API client

v1 (legacy) v2 (latest)
get frequentlyBoughtTogether → client.getRecommendations
get recommendations → client.getRecommendations
get relatedProducts → client.getRecommendations

Client imports

The imports for the API clients changed.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// Search API
import algoliasearch.api.SearchClient
// Recommend API
import algoliasearch.api.RecommendClient
// A/B testing API
import algoliasearch.api.AbtestingClient
// Analytics API
import algoliasearch.api.AnalyticsClient
// Ingestion API
import algoliasearch.api.IngestionClient
// Insights API
import algoliasearch.api.InsightsClient
// Monitoring API
import algoliasearch.api.MonitoringClient
// Personalization API
import algoliasearch.api.PersonalizationClient
// Query Suggestions API
import algoliasearch.api.QuerySuggestionsClient
// Usage API
import algoliasearch.api.UsageClient

No domain-specific language

All operations are methods of the SearchClient class. The domain-specific language used in v1 has been removed.

Wait for tasks

The wait method has been removed. Instead, use one of the following helpers:

Copy or moving indices, settings, synonyms, or rules

Use the operationIndex method, which replaces the following methods:

  • copyIndex
  • moveIndex
  • copyRules
  • copySynonyms
  • copySettings