Class DistanceScoringParameters

java.lang.Object
com.azure.search.documents.indexes.models.DistanceScoringParameters
All Implemented Interfaces:
com.azure.json.JsonSerializable<DistanceScoringParameters>

public final class DistanceScoringParameters extends Object implements com.azure.json.JsonSerializable<DistanceScoringParameters>
Provides parameter values to a distance scoring function.
  • Constructor Summary

    Constructors
    Constructor
    Description
    DistanceScoringParameters(String referencePointParameter, double boostingDistance)
    Creates an instance of DistanceScoringParameters class.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of DistanceScoringParameters from the JsonReader.
    double
    Get the boostingDistance property: The distance in kilometers from the reference location where the boosting range ends.
    Get the referencePointParameter property: The name of the parameter passed in search queries to specify the reference location.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • 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

    • 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.
    • 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.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<DistanceScoringParameters>
      Throws:
      IOException
    • fromJson

      public static DistanceScoringParameters fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      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:
      IllegalStateException - If the deserialized JSON object was missing any required properties.
      IOException - If an error occurs while reading the DistanceScoringParameters.