Nov 08, 2024
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
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.
Copy
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:
waitTaskto wait until indexing operations are donewaitAppTaskto wait for application-level taskswaitForApiKeyto wait for API key operations
Copy or moving indices, settings, synonyms, or rules
Use the operationIndex method,
which replaces the following methods:
copyIndexmoveIndexcopyRulescopySynonymscopySettings
Did you find this page helpful?