LocalStorage

public class LocalStorage
extends Object

java.lang.Object
   ↳ androidx.appsearch.localstorage.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 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 classes

class LocalStorage.SearchContext

Contains information about how to create the search session. 

Public methods

static ListenableFuture<AppSearchSession> createSearchSession(LocalStorage.SearchContext context)

Opens a new AppSearchSession on this storage with executor.

Inherited methods

Public methods

createSearchSession

public static ListenableFuture<AppSearchSession> createSearchSession (LocalStorage.SearchContext context)

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 LocalStorage.SearchContext contains all information to create a new AppSearchSession

Returns
ListenableFuture<AppSearchSession>