AppSearch
| Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |
|---|---|---|---|---|
| July 2, 2025 | 1.1.0 | - | - | - |
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.1.0" 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" // PlayServicesStorage is compatible with all devices that support Google Play Services on // all API levels. It offers the same features as PlatformStorage and is the recommended // solution for lower API levels on which PlatformStorage is not supported. implementation "androidx.appsearch:appsearch-play-services-storage:$appsearch_version" }
Kotlin
dependencies { val appsearch_version = "1.1.0" 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") // PlayServicesStorage is compatible with all devices that support Google Play Services on // all API levels. It offers the same features as PlatformStorage and is the recommended // solution for lower API levels on which PlatformStorage is not supported. implementation("androidx.appsearch:appsearch-play-services-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.
See the Issue Tracker documentation for more information.
Version 1.1
Version 1.1.0
July 2, 2025
androidx.appsearch:appsearch-*:1.1.0 is released. Version 1.1.0 contains these commits.
Version 1.1.0-rc01
May 20, 2025
androidx.appsearch:appsearch-*:1.1.0-rc01 is released. Version 1.1.0-rc01 contains these commits.
New Features
AppSearchmodule enters RC.- Adds a new experimental API to accumulate actions for the
PutDocumentsRequest#addTakenActionmethod (I7b726) - Add
SearchResult#TextMatchInfo,SearchResult#EmbeddingMatchInfo; restructureSearchResult#MatchInfofor providing match information for embeddings matches (I8f78d) - Introduce ranking functions for list manipulation (Ifa4ab)
API Changes
- Support
AppSearchannotation processor for blob handle property. (I9520b) - Update
AppSearchannotation processor to support quantization. (Ie0c85) - Adds a static
getFeatures()method to bothPlatformStorageandLocalStorage(I5a206)
Bug Fixes
- This library now uses JSpecify nullness annotations, which are type-use. Kotlin developers should use the following compiler arguments to enforce correct usage: -Xjspecify-annotations=strict, -Xtype-enhancement-improvements-strict-mode (I91f42, b/326456246)
Version 1.1.0-beta01
January 15, 2025
androidx.appsearch:appsearch-*:1.1.0-beta01 is released. Version 1.1.0-beta01 contains these commits.
New Features
AppSearchmodule enters Beta.
API Changes
- Disable experimental
AppSearchdelete propagation API due to stability issues. (Iea386) - Create
GlobalSearchApplicationInfoAPI, an experimental and optional way for producers and consumers to indicate interest in certain types. (I116fd) - Minor changes to experimental AST (query builder) APIs (Ibd852)
Bug Fixes
- This library now uses JSpecify nullness annotations, which are type-use. Kotlin developers should use the following compiler argument to enforce correct usage:
-Xjspecify-annotations=strict(this is the default starting with version 2.1.0 of the Kotlin compiler). (Ic2976, b/326456246) - Adds required permission to
searchPersonCorpus(I4431d)
Version 1.1.0-alpha07
December 11, 2024
androidx.appsearch:appsearch-*:1.1.0-alpha07 is released. Version 1.1.0-alpha07 contains these commits.
New Features
- Add
ExperimentalAppSearchApiannotation to new API surfaces that have not yet stabilized. (Ib09f4) - Support for efficiently storing and sharing binary blob data via
AppSearchSession#openBlobForWriteAsyncand related methods - Support for filtering query results by scoring expression via the
matchScoreExpressionfunction (Id525a) - Support for propagating deletion from parent document to child documents. (Ia032d)
- Support for embedding quantization API to increase embedding performance with slight quality loss. (Id8a07)
- Support for restricting searches to certain documents using the
addFilterDocumentIdsAPI inSearchSpec. (I7c6f1)
API Changes
- Move parent type information from
GenericDocumenttoSearchResult. (I34a1d) - Support for new action types in the
TakenActionAPI, includingDismissActionandImpressionAction. (I0c6c7) - Added new AppSearch builtin schema
WebPage. (I28127)
Version 1.1.0-alpha06
October 16, 2024
androidx.appsearch:appsearch-*:1.1.0-alpha06 is released. Version 1.1.0-alpha06 contains these commits.
API Changes
- Added node representing the
PropertyDefinedquery function. (I1aeaf) - Add nodes to represent numeric search and property restrict. (I963a9)
- Add node representing
GetSearchStringParameterquery function. (I4f99b) - Add node representing the
HasPropertyquery function. (I9c1c5) - Added interface for implementing functions in AST. (I9d42e)
- Add AND and OR operators. (Iaa442)
- Add
NegationNodefor representing logical negation of queries in AST. (Ia855a) - Add Node interface to
AppSearchfor defining nodes. (If42fb) - Adds an Experimental API annotation for
AppSearch. (I3e57c)
Bug Fixes
- Add
TextNodesfor holding terms. (Iefd02)
Security Fix
- As of this change, androidx compiles against protobuf 4.28.2 in order to address CVE-2024-7254. Upgrade your dependency on
androidx.appsearch:appsearch-external-protobufto the latest 1.1.0-alpha06 to address the vulnerability risk.
Version 1.1.0-alpha05
September 4, 2024
androidx.appsearch:appsearch-*:1.1.0-alpha05 is released. Version 1.1.0-alpha05 contains these commits.
API Changes
- Deprecates unnecessary
setEmbeddingSearchEnabledandgetEmbeddingSearchEnabled. DeletessetListFilterTokenizeFunctionEnabledandgetListFilterTokenizeFunctionEnabled. Deleted the 'tokenize' query function. Replaced withgetSearchStringParameterquery function andaddSearchStringParameterfunction. (I09f5a) - Rename
Alarm#getComputingDevicetogetOriginatingDevice. (I63121)
Version 1.1.0-alpha04
August 7, 2024
androidx.appsearch:appsearch-*:1.1.0-alpha04 is released. Version 1.1.0-alpha04 contains these commits.
New Features
- Support for new
PlayServicesStorageimplementation, which allows usingAppSearchon older devices without incurring the significant apk size cost ofLocalStorage. This storage implementation works by storing app data within the Play Services app. - Support for new APIs on devices running Android 15.
- Support searching the database by embedding vectors, allowing for fuzzy matching. (I2b41b)
- Support parent types and polymorphism within the
AppSearchschema model. (I06118) - Support the
TakenActionAPI which allows apps to report when results were clicked or abandoned, for quality boosting during subsequent searches. (I54091) - Support classes with builders in the annotation processor by introducing the new
@Document.BuilderProducerannotation. (Iec30a) - Support finer-grained control over which properties of a nested document get indexed. (Iec30a)
- Support for filtering searches to certain document properties. (Ib2659)
- Support finer-grained visibility settings by allowing OR and AND of visibility settings. (I0274b)
- Support for granting visibility of data to all apps that can see the existence of the owning app (public visibility). (I992e4)
- Support for retrieving only results that have data populated in a certain property. (I7d94f)
- Support for retrieving enterprise contacts in the personal profile. (Idd587)
API Changes
- Add
indexableNestedPropertiesListandinheritIndexableNestedPropertiesFromSuperclassannotation parameters to AppSearch'sDocument.DocumentPropertyannotation to allow indexing specific nested property paths. (Iec30a) - Support builder constructor to create builder instances in
AppSearchannotation processor (I265c9) - Update
AppSearchannotation processor to support setting parent types for polymorphism (I06118) - Adds
GetSchemaRequestmethod for clearing visibility settings (I38379) - Support
addParentTypein AppSearch for polymorphism (Ida14a) - Add APIs for additional ranking expressions (I5d9f4)
- Add
SearchActionAPI (I54091) - Adds description field for
AppSearchtypes (I84762) - Onboard embedding search query and ranking APIs to
AppSearch(I0f6c3) - Removes
getDeletionPropagation(I21192)
Version 1.1.0-alpha03
May 24, 2023
androidx.appsearch:appsearch-*:1.1.0-alpha03 is released. Version 1.1.0-alpha03 contains these commits.
New Features
- Support for an advanced query API, advanced scoring API, and numeric search. (I02d48)
- Adds
LocalStorage.createGlobalSearchSessionAPI to search across all databases within the local storage of a single app. (Id3c89) - Added an API to join documents by ID (Iaecfa)
- Support property weights to mark certain properties are more important when using
RANKING_STRATEGY_RELEVANCE_SCORING. (I069b9) - Add Person and
ContactPointfor querying Person corpus inAppSearch. (Ia58f9) - Added new Document type
ImageObjectmodeled after http://schema.org/ImageObject. (I6a0c0) - Add a
VERBATIMtokenizer which allows adding properties without interpretation byAppSearch. (I47bc0) - Added
RFC822_TOKENIZATIONas a tokenizer type, allowing tokenization of email addresses. (I8a390) - Enable Global Search in the Debug View. (I51fb2)
API Changes
- Removed methods that return
ListenableFutureand don't have Async suffix. (I0515f) - Adds the ability to configure projections by a
Documentclass. (I94576) - Add fields from
ThingtoAlarm,AlarmInstance,Timer,Stopwatch,StopwatchLap,ContactPoint, andPerson(Id876c)
Bug Fixes
- Fully support Android 13 features in appsearch-platform-storage (Ia8e61)
- Fix issues with overriding schema names and private fields when using inheritance.
Version 1.1.0-alpha02
August 24, 2022
androidx.appsearch:appsearch-*:1.1.0-alpha02 is released. Version 1.1.0-alpha02 contains these commits.
New Features
- Sped up Optimize process using index compaction rather than rebuilding index from scratch
- Changed native logging tag from "icing" to "AppSearchIcing", log INFO messages by default
API Changes
- Adds new
PropertyPathobject for working with paths, and newaddProjectionmethods to acceptPropertyPath. (I45588) - Added
builtin:ThingtoAppSearchbuiltin types (I55427) - Prevent empty property names in
GenericDocumentsooner – previously they were prevented at indexing time, now they are prevented atGenericDocument.Builder.build()time (I9e780)
Bug Fixes
- Removed unnecessary string formatting to improve RELEVANCE scoring performance
- More efficient pagination when encountering unreadable or deleted documents
- Implemented garbage collection for abandoned queries
- Fix nested indexing support for Documents. Previously indexNestedProperties was ignored. (Iae9a6)
External Contribution
- Shea Smith: Fix nested indexing support for Documents. (Iae9a6)
Version 1.1.0-alpha01
June 15, 2022
androidx.appsearch:appsearch-*:1.1.0-alpha01 is released. Version 1.1.0-alpha01 was developed in a private pre-release branch and has no public commits.
API Changes
- All methods returning
ListenableFuturehave been renamed to have the Async suffix. For example,getSchemahas been renamed togetSchemaAsync. The previous versions have been deprecated and will be removed in a future release.
New Features
- First release of appsearch-builtin-types. This project contains some builtin types based on schema.org which clients may find convenient to use instead of defining their own types for common objects. More types will be added in future releases.
- Ability to use
ShortcutAdapterto convert anAppSearchDocument into aShortcutInfoCompat. This gives clients a way to shareAppSearchdocuments to Google using the core-google-shortcuts library - Ability to use inheritance with
@Documentclasses. Fields cannot be replaced or modified, but new fields can be added by extending a class annotated with@Document. - New Observer API which allows clients to register for notifications when types they have access to have changed or when documents of those types are added, modified or removed. IMPORTANT: The current implementation delivers notifications only when your app is running. There is currently no way to inspect changes that have occurred while your app was stopped. Accordingly you should not rely on this API for completeness.
- Property parser API which allows you to fully handle and inspect property paths returned by
MatchInfo#getPropertyPath. - Global
getByIdand globalgetSchemaAPI for retrieving documents and schemas from other apps which have granted you visibility. - Ability to retrieve visibility information in
getSchemafor data you have access to - Ability to grant visibility to apps holding a certain Android permission (restricted to a narrow set of allowlisted permissions)
- Support
isFoo()-style getters for boolean fields in the annotation processor, in addition to the previous supported stylehasFoo() - Support for new features guarded behind
@RequiresFeature. UseAppSearchSession#getFeaturesto determine what the current backend supports. - Remove the ~13k token limit on individual documents
- Allow matching on non-ascii+non-alphanumeric characters, such as emojis
Bug Fixes
- Fix bug that would fail
SetSchemawhen overriding a nested incompatible type. - Fixes to fully support
@AutoValue-annotated classes being used as AppSearch@Documentclasses - Fixes for some crashes related to repeated lists of Document classes and other issues
- Fix for bug that would crash prefix search under certain circumstances
- Fix minor bug in
GetStorageInfothat would return incorrect values when encountering IO failures - Fix
BUSADDERRissues when reading a document - Fix logcat corruption caused by printing unformatted fingerprint
- Fix NPE caused by IO failures
- Fix memory leak in
GetSchemaType,Get,Delete,DeleteByNamespaceandDeleteBySchemaType
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.AppSearchManagerservice 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#getMatchesrenamed toSearchResult#getMatchInfos@Document.Int64Propertyrenamed 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.