Share via


TextWeights Class

  • java.lang.Object
    • com.azure.search.documents.indexes.models.TextWeights

Implements

public final class TextWeights
implements JsonSerializable<TextWeights>

Defines weights on index fields for which matches should boost scoring in search queries.

Constructor Summary

Constructor Description
TextWeights(Map<String,Double> weights)

Creates an instance of TextWeights class.

Method Summary

Modifier and Type Method and Description
static TextWeights fromJson(JsonReader jsonReader)

Reads an instance of TextWeights from the JsonReader.

Map<String,Double> getWeights()

Get the weights property: The dictionary of per-field weights to boost document scoring.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

TextWeights

public TextWeights(Map weights)

Creates an instance of TextWeights class.

Parameters:

weights - the weights value to set.

Method Details

fromJson

public static TextWeights fromJson(JsonReader jsonReader)

Reads an instance of TextWeights from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of TextWeights if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.

Throws:

IOException

- If the deserialized JSON object was missing any required properties.

getWeights

public Map getWeights()

Get the weights property: The dictionary of per-field weights to boost document scoring. The keys are field names and the values are the weights for each field.

Returns:

the weights value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to