Update the Kotlin API client
You should keep your Kotlin API client up to date to benefit from improvements and bug fixes. Algolia’s Service Level Agreement only applies to the latest version of the API client.
The Kotlin API client follows Semantic Versioning. You can check what the latest version of the API client is on the GitHub release page.
We released a new version of the JavaScript API client in public beta. Read the beta documentation for more information.
We released a new version of the PHP API client in public beta. Read the beta documentation for more information.
We released a new version of the Java API client in public beta. Read the beta documentation for more information.
Update to v2
Version 2.x
of the library uses ktor client version 2.x
. To migrate from 1.x
to 2.x
, follow these steps:
Ktor
Refer to Ktor’s migration guide.
LogLevel
The library uses its own LogLevel
instead of ktor’s Loglevel
.
Update your imports:
Subsystem | 1.x | 2.x |
---|---|---|
LogLevel | io.ktor.client.features.logging.LogLevel |
com.algolia.search.logging.LogLevel |
Public constants
Constants like KeyIndexName
, KeyEnglish
, and RouteIndexesV1
) aren’t exposed anymore. Use your own
constants instead.
You can find the internal constants in the package:
com.algolia.search.serialize.internal
.
This new version removes all deprecated methods and features from v1.
Update with Android Studio or IntelliJ Idea
Go to your build.gradle
or build.gradle.kts
file and synchronize it.
Check the line for com.algolia:algoliasearch-client-kotlin
: if you see the warning “a newer version com.algolia:algoliasearch-client-kotlin than X is available: Y”, you can replace X by Y and re-build your project.
Update without Android Studio or IntelliJ Idea
Go to the latest release on GitHub and note its release number, for example, X.Y.Z
.
Go to your build.gradle
or build.gradle.kts
file, find the line with com.algolia:algoliasearch-client-kotlin
, replace its version by X.Y.Z
and build your project to upgrade.