AppSearchSession.ReportUsage(ReportUsageRequest, IExecutor, IConsumer) Method

Definition

Reports usage of a particular document by namespace and ID.

[Android.Runtime.Register("reportUsage", "(Landroid/app/appsearch/ReportUsageRequest;Ljava/util/concurrent/Executor;Ljava/util/function/Consumer;)V", "", ApiSince=31)]
public void ReportUsage (Android.App.AppSearch.ReportUsageRequest request, Java.Util.Concurrent.IExecutor executor, Java.Util.Functions.IConsumer callback);
[<Android.Runtime.Register("reportUsage", "(Landroid/app/appsearch/ReportUsageRequest;Ljava/util/concurrent/Executor;Ljava/util/function/Consumer;)V", "", ApiSince=31)>]
member this.ReportUsage : Android.App.AppSearch.ReportUsageRequest * Java.Util.Concurrent.IExecutor * Java.Util.Functions.IConsumer -> unit

Parameters

request
ReportUsageRequest

The usage reporting request.

executor
IExecutor

Executor on which to invoke the callback.

callback
IConsumer

Callback to receive errors. If the operation succeeds, the callback will be invoked with null.

Attributes

Remarks

Reports usage of a particular document by namespace and ID.

A usage report represents an event in which a user interacted with or viewed a document.

For each call to #reportUsage, AppSearch updates usage count and usage recency metrics for that particular document. These metrics are used for ordering #search results by the SearchSpec#RANKING_STRATEGY_USAGE_COUNT and SearchSpec#RANKING_STRATEGY_USAGE_LAST_USED_TIMESTAMP ranking strategies.

Reporting usage of a document is optional.

Java documentation for android.app.appsearch.AppSearchSession.reportUsage(android.app.appsearch.ReportUsageRequest, java.util.concurrent.Executor, java.util.function.Consumer<android.app.appsearch.AppSearchResult<java.lang.Void>>).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to