SearchSpec.Builder.SetPropertyWeights 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.
Sets property weights by schema type and property path.
[Android.Runtime.Register("setPropertyWeights", "(Ljava/lang/String;Ljava/util/Map;)Landroid/app/appsearch/SearchSpec$Builder;", "", ApiSince=34)]
public Android.App.AppSearch.SearchSpec.Builder SetPropertyWeights(string schemaType, System.Collections.Generic.IDictionary<string,Java.Lang.Double> propertyPathWeights);
[<Android.Runtime.Register("setPropertyWeights", "(Ljava/lang/String;Ljava/util/Map;)Landroid/app/appsearch/SearchSpec$Builder;", "", ApiSince=34)>]
member this.SetPropertyWeights : string * System.Collections.Generic.IDictionary<string, Java.Lang.Double> -> Android.App.AppSearch.SearchSpec.Builder
Parameters
- schemaType
- String
the schema type to set property weights for. This value cannot be null.
- propertyPathWeights
- IDictionary<String,Double>
a Map of property paths of the schema type to the weight to set for that property. This value cannot be null.
Returns
- Attributes
Remarks
Sets property weights by schema type and property path. Property weights are used to promote and demote query term matches within a GenericDocument property when applying scoring. Property weights must be positive values (greater than 0). A property's weight is multiplied with that property's scoring contribution. This means weights set between 0.0 and 1.0 demote scoring contributions by a term match within the property. Weights set above 1.0 promote scoring contributions by a term match within the property. Properties that exist in the AppSearchSchema, but do not have a weight explicitly set will be given a default weight of 1.0. Weights set for property paths that do not exist in the AppSearchSchema will be discarded and not affect scoring. NOTE: Property weights only affect scoring for query-dependent scoring strategies, such as SearchSpec.RANKING_STRATEGY_RELEVANCE_SCORE.
Android reference for android.app.appsearch.SearchSpec.Builder.setPropertyWeights.
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.