SearchAction


@Document(name = "builtin:SearchAction")
class SearchAction : 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

Public functions

Int

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

String?

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

Inherited functions

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.

String

Returns the unique identifier of the TakenAction.

String

Returns the namespace of the TakenAction.

Public functions

getFetchedResultCount

Added in 1.1.0-alpha04
fun getFetchedResultCount(): Int

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
fun getQuery(): String?

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