FreshnessScoringFunction Class
- java.
lang. Object - com.
azure. search. documents. indexes. models. ScoringFunction - com.
azure. search. documents. indexes. models. FreshnessScoringFunction
- com.
- com.
public final class FreshnessScoringFunction
extends ScoringFunction
Defines a function that boosts scores based on the value of a date-time field.
Constructor Summary
| Constructor | Description |
|---|---|
| FreshnessScoringFunction(String fieldName, double boost, FreshnessScoringParameters parameters) |
Creates an instance of Freshness |
Method Summary
| Modifier and Type | Method and Description |
|---|---|
|
static
Freshness |
fromJson(JsonReader jsonReader)
Reads an instance of Freshness |
|
Freshness |
getParameters()
Get the parameters property: Parameter values for the freshness scoring function. |
| String |
getType()
Get the type property: Indicates the type of function to use. |
|
Freshness |
setInterpolation(ScoringFunctionInterpolation interpolation)
Set the interpolation property: A value indicating how boosting will be interpolated across document scores; defaults to "Linear". |
|
Json |
toJson(JsonWriter jsonWriter) |
Methods inherited from ScoringFunction
Methods inherited from java.lang.Object
Constructor Details
FreshnessScoringFunction
public FreshnessScoringFunction(String fieldName, double boost, FreshnessScoringParameters parameters)
Creates an instance of FreshnessScoringFunction class.
Parameters:
Method Details
fromJson
public static FreshnessScoringFunction fromJson(JsonReader jsonReader)
Reads an instance of FreshnessScoringFunction from the JsonReader.
Parameters:
Returns:
Throws:
getParameters
public FreshnessScoringParameters getParameters()
Get the parameters property: Parameter values for the freshness scoring function.
Returns:
getType
public String 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:
FreshnessScoringFunction.getType()Returns:
setInterpolation
public FreshnessScoringFunction setInterpolation(ScoringFunctionInterpolation interpolation)
Set the interpolation property: A value indicating how boosting will be interpolated across document scores; defaults to "Linear".
Overrides:
FreshnessScoringFunction.setInterpolation(ScoringFunctionInterpolation interpolation)Parameters:
toJson
public JsonWriter toJson(JsonWriter jsonWriter)
Overrides:
FreshnessScoringFunction.toJson(JsonWriter jsonWriter)Parameters:
Throws: