Share via


DistanceScoringParameters Class

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

Implements

public final class DistanceScoringParameters
implements JsonSerializable<DistanceScoringParameters>

Provides parameter values to a distance scoring function.

Constructor Summary

Constructor Description
DistanceScoringParameters(String referencePointParameter, double boostingDistance)

Creates an instance of DistanceScoringParameters class.

Method Summary

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

Reads an instance of DistanceScoringParameters from the JsonReader.

double getBoostingDistance()

Get the boostingDistance property: The distance in kilometers from the reference location where the boosting range ends.

String getReferencePointParameter()

Get the referencePointParameter property: The name of the parameter passed in search queries to specify the reference location.

JsonWriter toJson(JsonWriter jsonWriter)

Methods inherited from java.lang.Object

Constructor Details

DistanceScoringParameters

public DistanceScoringParameters(String referencePointParameter, double boostingDistance)

Creates an instance of DistanceScoringParameters class.

Parameters:

referencePointParameter - the referencePointParameter value to set.
boostingDistance - the boostingDistance value to set.

Method Details

fromJson

public static DistanceScoringParameters fromJson(JsonReader jsonReader)

Reads an instance of DistanceScoringParameters from the JsonReader.

Parameters:

jsonReader - The JsonReader being read.

Returns:

An instance of DistanceScoringParameters 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.

getBoostingDistance

public double getBoostingDistance()

Get the boostingDistance property: The distance in kilometers from the reference location where the boosting range ends.

Returns:

the boostingDistance value.

getReferencePointParameter

public String getReferencePointParameter()

Get the referencePointParameter property: The name of the parameter passed in search queries to specify the reference location.

Returns:

the referencePointParameter value.

toJson

public JsonWriter toJson(JsonWriter jsonWriter)

Parameters:

jsonWriter

Throws:

Applies to