SearchAction
@Document(name = "builtin:SearchAction")
@ExperimentalAppSearchApi
public class SearchAction extends TakenAction
| java.lang.Object | ||
| ↳ | 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 |
|---|
@Document.BuilderProducerBuilder for |
Public methods |
|
|---|---|
int |
Returns total number of results fetched from AppSearch by the client in this |
@Nullable String |
getQuery()Returns the user-entered search input (without any operators or rewriting). |
Inherited methods |
||||||||
|---|---|---|---|---|---|---|---|---|
|
Public methods
getFetchedResultCount
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.