Partager via


Migrator.OnDowngrade(Int32, Int32, GenericDocument) Method

Definition

Migrates GenericDocument to an older version of AppSearchSchema.

[Android.Runtime.Register("onDowngrade", "(IILandroid/app/appsearch/GenericDocument;)Landroid/app/appsearch/GenericDocument;", "GetOnDowngrade_IILandroid_app_appsearch_GenericDocument_Handler", ApiSince=31)]
public abstract Android.App.AppSearch.GenericDocument OnDowngrade (int currentVersion, int finalVersion, Android.App.AppSearch.GenericDocument document);
[<Android.Runtime.Register("onDowngrade", "(IILandroid/app/appsearch/GenericDocument;)Landroid/app/appsearch/GenericDocument;", "GetOnDowngrade_IILandroid_app_appsearch_GenericDocument_Handler", ApiSince=31)>]
abstract member OnDowngrade : int * int * Android.App.AppSearch.GenericDocument -> Android.App.AppSearch.GenericDocument

Parameters

currentVersion
Int32

The current version of the document's schema.

finalVersion
Int32

The final version that documents need to be migrated to.

document
GenericDocument

The GenericDocument need to be translated to new version.

Returns

A GenericDocument in new version.

Attributes

Remarks

Migrates GenericDocument to an older version of AppSearchSchema.

This method will be invoked only if the SetSchemaRequest is setting a lower version number than the current AppSearchSchema saved in AppSearch.

If this Migrator is provided to cover a compatible schema change via AppSearchSession#setSchema, documents under the old version won't be removed unless you use the same document ID.

This method will be invoked on the background worker thread.

Java documentation for android.app.appsearch.Migrator.onDowngrade(int, int, android.app.appsearch.GenericDocument).

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