AppSearch
Latest Update | Stable Release | Release Candidate | Beta Release | Alpha Release |
---|---|---|---|---|
August 24, 2022 | - | - | - | 1.1.0-alpha02 |
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-alpha02" 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.1.0-alpha02" 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.
See the Issue Tracker documentation for more information.
Version 1.1
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
PropertyPath
object for working with paths, and newaddProjection
methods to acceptPropertyPath
. (I45588) - Added
builtin:Thing
toAppSearch
builtin types (I55427) - Prevent empty property names in
GenericDocument
sooner – 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
ListenableFuture
have been renamed to have the Async suffix. For example,getSchema
has 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
ShortcutAdapter
to convert anAppSearch
Document into aShortcutInfoCompat
. This gives clients a way to shareAppSearch
documents to Google using the core-google-shortcuts library - Ability to use inheritance with
@Document
classes. 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
getById
and globalgetSchema
API for retrieving documents and schemas from other apps which have granted you visibility. - Ability to retrieve visibility information in
getSchema
for 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#getFeatures
to 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
SetSchema
when overriding a nested incompatible type. - Fixes to fully support
@AutoValue
-annotated classes being used as AppSearch@Document
classes - 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
GetStorageInfo
that would return incorrect values when encountering IO failures - Fix
BUSADDERR
issues 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
,DeleteByNamespace
andDeleteBySchemaType
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 toSearchResult#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
.