SearchAction
@Document(name = "builtin:SearchAction")
@ExperimentalAppSearchApi
class SearchAction : TakenAction
| kotlin.Any | ||
| ↳ | androidx.appsearch.usagereporting.TakenAction | |
| ↳ | androidx.appsearch.usagereporting.SearchAction |
SearchAction is a built-in AppSearch document type that contains different metrics.
- Clients can report the user's search actions.
- Usually
SearchActionis reported together withClickAction, since the user clicks onandroidx.appsearch.app.SearchResultdocuments after searching.
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 |
Public functions |
|
|---|---|
Int |
Returns total number of results fetched from AppSearch by the client in this |
String? |
getQuery()Returns the user-entered search input (without any operators or rewriting). |
Inherited functions |
||||||||
|---|---|---|---|---|---|---|---|---|
|
Public functions
getFetchedResultCount
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.