Språk

SearchSpec.Builder.SetResultGrouping(Int32, Int32) Method

Definition

Sets the maximum number of results to return for each group, where groups are defined by grouping type.

[Android.Runtime.Register("setResultGrouping", "(II)Landroid/app/appsearch/SearchSpec$Builder;", "", ApiSince=31)]
public Android.App.AppSearch.SearchSpec.Builder SetResultGrouping(int groupingTypeFlags, int limit);
[<Android.Runtime.Register("setResultGrouping", "(II)Landroid/app/appsearch/SearchSpec$Builder;", "", ApiSince=31)>]
member this.SetResultGrouping : int * int -> Android.App.AppSearch.SearchSpec.Builder

Parameters

groupingTypeFlags
Int32

A nonzero combination of PerPackage, PerNamespace, and PerSchema, cast to int. PerSchema requires Android 15 (API level 35) or later.

limit
Int32

Number of results to return per groupingTypeFlags.

Returns

This builder instance.

Attributes

Remarks

Sets the maximum number of results to return for each group, where groups are defined by grouping type. Each call replaces the previous grouping. For example, calling SetResultGrouping((int)GroupingType.PerPackage, 7) and then SetResultGrouping((int)GroupingType.PerPackage, 2) sets a limit of two results per package. Calling SetResultGrouping((int)GroupingType.PerPackage, 1) and then SetResultGrouping((int)(GroupingType.PerPackage | GroupingType.PerNamespace), 5) sets a limit of five results per package and namespace.

Android reference for android.app.appsearch.SearchSpec.Builder.setResultGrouping.

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