Skip to main content

Upgrade from InstantSearch v4 to v5

InstantSearch Android 5.0 targets Android 17 (API level 37) and builds with Kotlin 2.4, Android Gradle Plugin (AGP) 9, and Compose 1.12. The InstantSearch API doesn’t change: widgets, connectors, searchers, filters, and Insights keep the 4.x signatures. The major version reflects new build requirements that every app using the library must meet.

Requirements

The published libraries declare minCompileSdk = 37. Gradle refuses to resolve them from a module with a lower compileSdk, so update compileSdk first.

Update the build tools

Set compileSdk to 37 in every Android module that depends on InstantSearch, and update AGP to 9.1.1 or later, the first release that supports API level 37. AGP 9 requires Gradle 9.
gradle/libs.versions.toml
gradle/wrapper/gradle-wrapper.properties
If you’re coming from AGP 8, read the AGP 9.0 release notes. The changes that affect a typical InstantSearch app:
  • AGP includes Kotlin support. Remove the org.jetbrains.kotlin.android (kotlin-android) plugin from your Android modules.
  • kotlin { compilerOptions } replaces kotlinOptions.
  • composeOptions { kotlinCompilerExtensionVersion } is no longer needed. Apply the org.jetbrains.kotlin.plugin.compose plugin instead.

Target Java 11

The Android libraries (instantsearch-android, instantsearch-compose, instantsearch-insights-android, instantsearch-android-paging3, instantsearch-android-loading) compile to Java 11 bytecode, like current AndroidX libraries. InstantSearch exposes public inline functions such as QueryRuleCustomDataConnector and MutableFilters.add, so Kotlin refuses to inline Java 11 bytecode into a module compiled for Java 8:
Set the Java and Kotlin targets to 11 in your Android modules. minSdk stays at 23: D8 rewrites Java 11 language features for older devices.
The JVM-only libraries (instantsearch-core, instantsearch-coroutines-extensions, and the -jvm variants) still target Java 8.

Update dependencies

build.gradle
Transitive dependencies that moved to a new version line and may conflict with versions pinned in your app:

Non-null onCheckedChanged parameters

FilterMapViewRadioGroup and FilterToggleViewCompoundButton implement the platform OnCheckedChangeListener interfaces. API level 37 marks these callback parameters as non-null, so the overrides changed:
This only affects your own OnCheckedChangeListener implementations that still use the old signatures with ?: with compileSdk 37, the Kotlin compiler reports 'onCheckedChanged' overrides nothing until you remove the ?.

Migration checklist

  1. Update the build tools: Gradle 9, AGP 9.1.1 or later, Kotlin 2.4 or later
  2. Set compileSdk to 37 in every Android module that depends on InstantSearch
  3. Set the Java and Kotlin targets to 11 (compileOptions and jvmTarget) in those modules
  4. Remove the kotlin-android plugin and migrate kotlinOptions to kotlin { compilerOptions } if you upgraded from AGP 8
  5. Update the InstantSearch dependencies to 5.+
  6. Align Compose: use a BOM that maps to Compose 1.12.1 or later, and declare material-icons-core or material-icons-extended if your code uses Icons
  7. Fix OnCheckedChangeListener overrides that still use parameters with ?
  8. Review the Android 17 behavior changes for your app before you set targetSdk to 37, in particular the large-screen changes (Android ignores orientation and resizing restrictions on screens 600dp and wider) and the local network permission. The library declares no Activity, Service, or permission, so it isn’t affected
  9. Run your test suite on an Android 17 emulator or device

Upgrade from InstantSearch v3 to v4

In InstantSearch v4.0.0 and later, InstantSearch uses Kotlin 2.2 and the Algolia Kotlin API client 3.x. This client updates models and simplifies types.
Kotlin
InstantSearch v4.0 is a major upgrade and includes breaking changes. It removes wrapper types and legacy searchers (Answers and Places), and updates Insights to v3 events.

Requirements

InstantSearch Android 4.x has updated minimum requirements:

Wrapper types removed

The Kotlin API client 3.x removed primitive wrapper types. Use plain String values instead:

Search parameters

Replaces the Query class with SearchParamsObject from the Algolia Kotlin Client 3.x:

Response types

Search response types have been updated to match the Kotlin API client 3.x:

Filters

InstantSearch now owns its own filter model. Update your imports:

Request options

RequestOptions uses immutable construction from the Algolia Kotlin Client 3.x:

Insights

Insights has been updated to use v3 events and the pushEvents API:

Trackers

Tracker initialization now uses String for event names:

Indexable interface

Hit models for tracking must implement the Indexable interface:
Kotlin

Removed features

The following features have been removed in v4:

Dependencies

Update your dependencies in build.gradle or gradle/libs.versions.toml:

Migration checklist

  1. Update dependencies to the versions listed above
  2. Update minSdk to 23 in your build.gradle
  3. Remove wrapper types: replace ApplicationID, APIKey, IndexName, Attribute, ObjectID, QueryID, EventName, UserToken with plain String
  4. Update query types: replace Query with SearchParamsObject
  5. Update response types: replace ResponseSearch with SearchResponse, Facet with FacetHits
  6. Update filter imports: use com.algolia.instantsearch.filter.Filter instead of com.algolia.search.model.filter.Filter
  7. Update Insights: use v3 event methods instead of InsightsEvent constructors
  8. Implement Indexable: ensure hit models implement Indexable for tracking
  9. Remove Answers/Places: if using SearcherAnswers or SearcherPlaces, migrate to standard search
  10. Test thoroughly: the new versions include significant internal changes

Upgrade event tracking

Starting from v3.2.0, InstantSearch makes it easier to send view events using the isAutoSendingHitsViewEvents option on HitsSearcher:
Kotlin
From v3.2.0 to v3.3.0, this option was set to true by default. Ensure you’re using the latest version of InstantSearch to send the required events.

Upgrade from InstantSearch v2 to v3

The library version 3.0 uses Kotlin 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 v2.

InstantSearch Android package

InstantSearch Android package has changed. Update your imports accordingly:

Kotlin API client

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

LogLevel

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

Public constants

Constants (for example, KeyIndexName, KeyEnglish, and RouteIndexesV1) aren’t exposed. Use your constants instead.

Ktor client

For more information, refer to Ktor’s migration guide.

Searchers

Legacy searchers are removed. Migrate as follows:

Extension modules

Multiple extensions have been extracted to modules:

Upgrade from InstantSearch v1 to v2

InstantSearch v2 introduces a new architecture and new widgets, which brings several breaking changes from v1:
  • No longer an InstantSearch component automatically connecting widgets. You are now in control of the Searcher and responsible for connecting and disconnecting it from widgets and other components.
  • The widgets are now built around ViewModels, holding their data and business logic. Compared to the V1 where widgets were Android Views, now the core of the widget is its view-model, and the UI is behind an interface to ensure minimal coupling.
You can learn more about the philosophy of InstantSearch v2 in What is InstantSearch. Once ready to start migrating, learn the steps to building an InstantSearch v2 app in the getting started guide..
The InstantSearch Android v1 documentation is available on the legacy docs page.
Last modified on October 16, 2026