AppSearchSession.Remove Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Remove(RemoveByDocumentIdRequest, IExecutor, IBatchResultCallback) |
Removes |
Remove(String, SearchSpec, IExecutor, IConsumer) |
Removes |
Remove(RemoveByDocumentIdRequest, IExecutor, IBatchResultCallback)
Removes GenericDocument
objects by document IDs in a namespace from the AppSearchSession
database.
[Android.Runtime.Register("remove", "(Landroid/app/appsearch/RemoveByDocumentIdRequest;Ljava/util/concurrent/Executor;Landroid/app/appsearch/BatchResultCallback;)V", "", ApiSince=31)]
public void Remove (Android.App.AppSearch.RemoveByDocumentIdRequest request, Java.Util.Concurrent.IExecutor executor, Android.App.AppSearch.IBatchResultCallback callback);
[<Android.Runtime.Register("remove", "(Landroid/app/appsearch/RemoveByDocumentIdRequest;Ljava/util/concurrent/Executor;Landroid/app/appsearch/BatchResultCallback;)V", "", ApiSince=31)>]
member this.Remove : Android.App.AppSearch.RemoveByDocumentIdRequest * Java.Util.Concurrent.IExecutor * Android.App.AppSearch.IBatchResultCallback -> unit
Parameters
- request
- RemoveByDocumentIdRequest
RemoveByDocumentIdRequest
with IDs in a namespace to remove from the
index.
- executor
- IExecutor
Executor on which to invoke the callback.
- callback
- IBatchResultCallback
Callback to receive the pending result of performing this operation. The keys
of the returned AppSearchBatchResult
are the input document IDs. The values are
null
on success, or a failed AppSearchResult
otherwise. IDs that are not
found will return a failed AppSearchResult
with a result code of AppSearchResult#RESULT_NOT_FOUND
. If an unexpected internal error occurs in the
AppSearch service, BatchResultCallback#onSystemError
will be invoked with a
Throwable
.
- Attributes
Remarks
Removes GenericDocument
objects by document IDs in a namespace from the AppSearchSession
database.
Removed documents will no longer be surfaced by #search
or #getByDocumentId
calls.
Once the database crosses the document count or byte usage threshold, removed documents will be deleted from disk.
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
Remove(String, SearchSpec, IExecutor, IConsumer)
Removes GenericDocument
s from the index by Query.
[Android.Runtime.Register("remove", "(Ljava/lang/String;Landroid/app/appsearch/SearchSpec;Ljava/util/concurrent/Executor;Ljava/util/function/Consumer;)V", "", ApiSince=31)]
public void Remove (string queryExpression, Android.App.AppSearch.SearchSpec searchSpec, Java.Util.Concurrent.IExecutor executor, Java.Util.Functions.IConsumer callback);
[<Android.Runtime.Register("remove", "(Ljava/lang/String;Landroid/app/appsearch/SearchSpec;Ljava/util/concurrent/Executor;Ljava/util/function/Consumer;)V", "", ApiSince=31)>]
member this.Remove : string * Android.App.AppSearch.SearchSpec * Java.Util.Concurrent.IExecutor * Java.Util.Functions.IConsumer -> unit
Parameters
- queryExpression
- String
Query String to search.
- searchSpec
- SearchSpec
Spec containing schemaTypes, namespaces and query expression indicates how document will be removed. All specific about how to scoring, ordering, snippeting and resulting will be ignored.
- executor
- IExecutor
Executor on which to invoke the callback.
- callback
- IConsumer
Callback to receive errors resulting from removing the documents. If the
operation succeeds, the callback will be invoked with null
.
- Attributes
Remarks
Removes GenericDocument
s from the index by Query. Documents will be removed if they match the queryExpression
in given namespaces and schemaTypes which is set via SearchSpec.Builder#addFilterNamespaces
and SearchSpec.Builder#addFilterSchemas
.
An empty queryExpression
matches all documents.
An empty set of namespaces or schemaTypes matches all namespaces or schemaTypes in the current database.
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.