SearchAction


@Document(name = "builtin:SearchAction")
public class SearchAction extends TakenAction


SearchAction is a built-in AppSearch document type that contains different metrics.

In order to use this document type, the client must explicitly set this schema type via addDocumentClasses.

Since SearchAction is an AppSearch document, the client can handle deletion via removeAsync or document time-to-live (TTL). The default TTL is 60 days.

Summary

Nested types

Builder for SearchAction.

Public methods

int

Returns total number of results fetched from AppSearch by the client in this SearchAction.

@Nullable String

Returns the user-entered search input (without any operators or rewriting).

Inherited methods

From androidx.appsearch.usagereporting.TakenAction
long

Returns the timestamp when the user took the action, in milliseconds since Unix epoch.

long

Returns the time-to-live (TTL) of the TakenAction document as a duration in milliseconds.

@NonNull String

Returns the unique identifier of the TakenAction.

@NonNull String

Returns the namespace of the TakenAction.

Public methods

getFetchedResultCount

Added in 1.1.0-alpha04
public int getFetchedResultCount()

Returns total number of results fetched from AppSearch by the client in this SearchAction.

If unset, then it will be set to -1 to mark invalid.

getQuery

Added in 1.1.0-alpha04
public @Nullable String getQuery()

Returns the user-entered search input (without any operators or rewriting).