Migrate from 2.x to 3.x

June 14, 2024 ยท View on GitHub

The library version 2.0 uses Kotlin version 1.6 and Algolia Kotlin API Client 2.0. Below are the steps to migrate.

This new version removes all deprecated methods and features from v1.

Table of Contents

InstantSearch Android Package

InstantSearch Android package has changed. Please update your imports accordingly:

Module2.x3.x
InstantSearch Androidcom.algolia.instantsearch.helper.androidcom.algolia.instantsearch.android

Kotlin API Client

Kotlin API client (and its underlying Ktor client) is part of the library's binary interface. Please follow its migration guide, or apply the following changes:

LogLevel

The library uses LogLevel from the Kotlin API client instead of Ktor's Loglevel:

Subsystem2.x3.x
Loglevelio.ktor.client.features.logging.LogLevelcom.algolia.search.logging.LogLevel

Public constants

Constants (e.g. KeyIndexName, KeyEnglish and RouteIndexesV1) are not exposed anymore. Please use your constants instead.

Ktor client

Refer to Ktor's migration guide.

Searchers

Legacy searchers are removed; please migrate as follows:

Searcher2.x3.x
Single Index SearcherSearcherSingleIndexHitsSearcher
Facets SearcherSearcherForFacetsFacetsSearcher
Multi Index SearcherSearcherMultipleIndexMultiSearcher

Extension modules

Multiple extensions have been extracted to modules:

SubsystemModule
Androidx SwipeRefreshLayoutcom.algolia:instantsearch-android-loading
Androidx Paging 3com.algolia:instantsearch-android-paging3
Androidx Paging 2Removed