GlobalSearchSession

public interface GlobalSearchSession
implements Closeable

androidx.appsearch.app.GlobalSearchSession


Provides a connection to all AppSearch databases the querying application has been granted access to.

All implementations of this interface must be thread safe.

See also:

Summary

Public methods

abstract void close()

Closes the GlobalSearchSession.

abstract Capabilities getCapabilities()

Returns the Capabilities to check for the availability of certain features for this session.

abstract ListenableFuture<Void> reportSystemUsage(ReportSystemUsageRequest request)

Reports that a particular document has been used from a system surface.

abstract SearchResults search(String queryExpression, SearchSpec searchSpec)

Retrieves documents from all AppSearch databases that the querying application has access to.

Inherited methods

Public methods

close

public abstract void close ()

Closes the GlobalSearchSession.

getCapabilities

public abstract Capabilities getCapabilities ()

Returns the Capabilities to check for the availability of certain features for this session.

Returns
Capabilities

reportSystemUsage

public abstract ListenableFuture<Void> reportSystemUsage (ReportSystemUsageRequest request)

Reports that a particular document has been used from a system surface.

See AppSearchSession.reportUsage(ReportUsageRequest) for a general description of document usage, as well as an API that can be used by the app itself.

Usage reported via this method is accounted separately from usage reported via AppSearchSession.reportUsage(ReportUsageRequest) and may be accessed using the constants SearchSpec.RANKING_STRATEGY_SYSTEM_USAGE_COUNT and SearchSpec.RANKING_STRATEGY_SYSTEM_USAGE_LAST_USED_TIMESTAMP.

Parameters
request ReportSystemUsageRequest

Returns
ListenableFuture<Void> The pending result of performing this operation which resolves to null on