Class TagScoringFunction
java.lang.Object
com.azure.search.documents.indexes.models.ScoringFunction
com.azure.search.documents.indexes.models.TagScoringFunction
- All Implemented Interfaces:
com.azure.json.JsonSerializable<ScoringFunction>
Defines a function that boosts scores of documents with string values matching a given list of tags.
-
Constructor Summary
ConstructorsConstructorDescriptionTagScoringFunction(String fieldName, double boost, TagScoringParameters parameters) Creates an instance of TagScoringFunction class. -
Method Summary
Modifier and TypeMethodDescriptionstatic TagScoringFunctionfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of TagScoringFunction from the JsonReader.Get the parameters property: Parameter values for the tag scoring function.getType()Get the type property: Indicates the type of function to use.setInterpolation(ScoringFunctionInterpolation interpolation) Set the interpolation property: A value indicating how boosting will be interpolated across document scores; defaults to "Linear".com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) Methods inherited from class ScoringFunction
getBoost, getFieldName, getInterpolationMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
TagScoringFunction
Creates an instance of TagScoringFunction class.- Parameters:
fieldName- the fieldName value to set.boost- the boost value to set.parameters- the parameters value to set.
-
-
Method Details
-
getType
Get the type property: Indicates the type of function to use. Valid values include magnitude, freshness, distance, and tag. The function type must be lower case.- Overrides:
getTypein classScoringFunction- Returns:
- the type value.
-
getParameters
Get the parameters property: Parameter values for the tag scoring function.- Returns:
- the parameters value.
-
setInterpolation
Set the interpolation property: A value indicating how boosting will be interpolated across document scores; defaults to "Linear".- Overrides:
setInterpolationin classScoringFunction- Parameters:
interpolation- the interpolation value to set.- Returns:
- the ScoringFunction object itself.
-
toJson
- Specified by:
toJsonin interfacecom.azure.json.JsonSerializable<ScoringFunction>- Overrides:
toJsonin classScoringFunction- Throws:
IOException
-
fromJson
Reads an instance of TagScoringFunction from the JsonReader.- Parameters:
jsonReader- The JsonReader being read.- Returns:
- An instance of TagScoringFunction 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 TagScoringFunction.
-