Class RankFeatureQueryBuilders

java.lang.Object
org.opensearch.index.query.RankFeatureQueryBuilders

public final class RankFeatureQueryBuilders extends Object
  • Method Details

    • saturation

      public static RankFeatureQueryBuilder saturation(String fieldName, float pivot)
      Return a new RankFeatureQueryBuilder that will score documents as boost * S / (S + pivot) where S is the value of the static feature.
      Parameters:
      fieldName - field that stores features
      pivot - feature value that would give a score contribution equal to weight/2, must be in (0, +Infinity)
    • saturation

      public static RankFeatureQueryBuilder saturation(String fieldName)
      Same as saturation(String, float) but a reasonably good default pivot value is computed based on index statistics and is approximately equal to the geometric mean of all values that exist in the index.
      Parameters:
      fieldName - field that stores features
    • log

      public static RankFeatureQueryBuilder log(String fieldName, float scalingFactor)
      Return a new RankFeatureQueryBuilder that will score documents as boost * Math.log(scalingFactor + S) where S is the value of the static feature.
      Parameters:
      fieldName - field that stores features
      scalingFactor - scaling factor applied before taking the logarithm, must be in [1, +Infinity)
    • sigmoid

      public static RankFeatureQueryBuilder sigmoid(String fieldName, float pivot, float exp)
      Return a new RankFeatureQueryBuilder that will score documents as boost * S^a / (S^a + pivot^a) where S is the value of the static feature.
      Parameters:
      fieldName - field that stores features
      pivot - feature value that would give a score contribution equal to weight/2, must be in (0, +Infinity)
      exp - exponent, higher values make the function grow slower before 'pivot' and faster after 'pivot', must be in (0, +Infinity)
    • linear

      public static RankFeatureQueryBuilder linear(String fieldName)
      Return a new RankFeatureQueryBuilder that will score documents as S) where S is the indexed value of the static feature.
      Parameters:
      fieldName - field that stores features