LocalStorage
class LocalStorage
An AppSearch storage system which stores data locally in the app's storage space using a bundled version of the search native library.
The search native library is an on-device searching library that allows apps to define androidx.appsearch.app.AppSearchSchemas, save and query a variety of Documents. The library needs to be initialized before using, which will create a folder to save data in the app's storage space.
Queries are executed multi-threaded, but a single thread is used for mutate requests (put, delete, etc..).
Summary
Nested types |
|---|
|
Contains information relevant to creating a global search session. |
|
Builder for |
|
Contains information about how to create the search session. |
|
Builder for |
Public functions |
|
|---|---|
java-static ListenableFuture<GlobalSearchSession!> |
Opens a new |
java-static ListenableFuture<AppSearchSession!> |
Opens a new |
java-static Features |
Returns the |
Public functions
createGlobalSearchSessionAsync
java-static fun createGlobalSearchSessionAsync(
context: LocalStorage.GlobalSearchContext
): ListenableFuture<GlobalSearchSession!>
Opens a new GlobalSearchSession on this storage.
The GlobalSearchSession opened from this LocalStorage allows the user to search across all local databases within the LocalStorage of this app, however cross-app search is not possible with LocalStorage.
This process requires a native search library. If it's not created, the initialization process will create one.
createSearchSessionAsync
java-static fun createSearchSessionAsync(context: LocalStorage.SearchContext): ListenableFuture<AppSearchSession!>
Opens a new AppSearchSession on this storage with executor.
This process requires a native search library. If it's not created, the initialization process will create one.
| Parameters | |
|---|---|
context: LocalStorage.SearchContext |
The |
getFeatures
@ExperimentalAppSearchApi
java-static fun getFeatures(): Features
Returns the Features to check for the availability of certain features for this AppSearch storage.