AppSearch

AppSearch is an on-device search library for managing locally stored structured data, with APIs for indexing data and retrieving data using full-text search. Use it to build custom in-app search capabilities for your users.
Latest Update Current Stable Release Next Release Candidate Beta Release Alpha Release
November 3, 2021 - - - 1.0.0-alpha04

Declaring dependencies

To add a dependency on AppSearch, you must add the Google Maven repository to your project. Read Google's Maven repository for more information.

Add the dependencies for the artifacts you need in the build.gradle file for your app or module:

Groovy

dependencies {
    def appsearch_version = "1.0.0-alpha04"

    implementation "androidx.appsearch:appsearch:$appsearch_version"
    // Use kapt instead of annotationProcessor if writing Kotlin classes
    annotationProcessor "androidx.appsearch:appsearch-compiler:$appsearch_version"

    implementation "androidx.appsearch:appsearch-local-storage:$appsearch_version"
    // PlatformStorage is compatible with Android 12+ devices, and offers additional features
    // to LocalStorage.
    implementation "androidx.appsearch:appsearch-platform-storage:$appsearch_version"
}

Kotlin

dependencies {
    val appsearch_version = "1.0.0-alpha04"

    implementation("androidx.appsearch:appsearch:$appsearch_version")
    // Use annotationProcessor instead of kapt if writing Java classes
    kapt("androidx.appsearch:appsearch-compiler:$appsearch_version")

    implementation("androidx.appsearch:appsearch-local-storage:$appsearch_version")
    // PlatformStorage is compatible with Android 12+ devices, and offers additional features
    // to LocalStorage.
    implementation("androidx.appsearch:appsearch-platform-storage:$appsearch_version")
}

For more information about dependencies, see Add Build Dependencies.

Feedback

Your feedback helps make Jetpack better. Let us know if you discover new issues or have ideas for improving this library. Please take a look at the existing issues in this library before you create a new one. You can add your vote to an existing issue by clicking the star button.

Create a new issue

See the Issue Tracker documentation for more information.

Version 1.0.0

Version 1.0.0-alpha04

November 3, 2021

androidx.appsearch:appsearch-*:1.0.0-alpha04 is released. Version 1.0.0-alpha04 contains these commits.

New Features

  • Guava ListenableFuture dependency automatically brought in as an API dependency

API Changes

  • Add SearchResult#getSubmatchRange() and SearchResult#getSubmatch() to provide more information about each match. (I2fef6)
  • Clarify documentation around how to generate PackageIdentifier fingerprints for sharing data by packagename+certificate

Bug Fixes

  • Fix crash if user tries to fetch result pages after the end of the result set
  • Fix issue with all namespaces being queried if only invalid namespaces were supplied as query filters
  • Fix issue with all namespaces being removed if only invalid namespaces were supplied as remove-by-query filtersLo
  • Fix issue where document data stopped being indexed after a certain point for very large documents
  • Fix issue where tokenization would drop segments with non-Ascii numeric characters
  • Add check for consecutive failed initialization attempts to help break out of potential bad state that prevents successful initialization.

Version 1.0.0-alpha03

July 21, 2021

androidx.appsearch:appsearch-*:1.0.0-alpha03 is released. Version 1.0.0-alpha03 contains these commits.

New Features

  • Release of the Platform Storage Backend to allow clients to use the AppSearch API with the new android.app.appsearch.AppSearchManager service launching in Android S. For more details, please visit AppSearch Developer Guide.
  • Annotation processor support for AutoValue
  • Removal of maximum size limit of single string property
  • New storage format to reduce initialization latency
  • A one-time, internal data migration from old storage format to new storage format

Bug Fixes

  • Correctly enforces maximum document limit when inserting new documents
  • Fixed crash during AppSearchSession creation
  • Fixed bugs in SetSchema that were not detecting some cases of backwards incompatibility and index incompatibility

Version 1.0.0-alpha02

June 30, 2021

androidx.appsearch:appsearch:1.0.0-alpha02, androidx.appsearch:appsearch-compiler:1.0.0-alpha02, and androidx.appsearch:appsearch-local-storage:1.0.0-alpha02 are released. Version 1.0.0-alpha02 contains these commits.

New Features

  • Full support of Chinese/Japanese/Korean/Thai languages
  • Reduced size of androidx.appsearch:appsearch-local-storage
  • Removal of maximum size limit of repeated properties
  • Allow reuse of builder classes
  • Improvements in toString() of certain objects for easier debugging
  • Javadoc documentation improvements

API Changes

  • SearchResult#getMatches renamed to SearchResult#getMatchInfos
  • @Document.Int64Property renamed to @Document.LongProperty

Bug Fixes

  • Improvements and fixes to computation of result snippets
  • Fixes to bugs in AppSearchSession initialization

Version 1.0.0-alpha01

May 5, 2021

androidx.appsearch:appsearch:1.0.0-alpha01, androidx.appsearch:appsearch-compiler:1.0.0-alpha01, and androidx.appsearch:appsearch-local-storage:1.0.0-alpha01 are released. Version 1.0.0-alpha01 contains these commits.

New Features

AppSearch is a search library for managing locally stored structured data, with APIs for indexing data and retrieving data via full-text search. Use it to build custom in-app search capabilities for your users. This initial release is 1.0.0-alpha01.