Enum Class VariantPickingStrategy

java.lang.Object
java.lang.Enum<VariantPickingStrategy>
de.cxp.ocs.elasticsearch.mapper.VariantPickingStrategy
All Implemented Interfaces:
Serializable, Comparable<VariantPickingStrategy>, Constable, BiFunction<org.elasticsearch.search.SearchHits,Integer,org.elasticsearch.search.SearchHit>

public enum VariantPickingStrategy extends Enum<VariantPickingStrategy> implements BiFunction<org.elasticsearch.search.SearchHits,Integer,org.elasticsearch.search.SearchHit>
A variant-picking-strategy defines how variants are chosen to be result-hits instead of their main product.
  • Enum Constant Details

    • pickAlways

      public static final VariantPickingStrategy pickAlways
      pick first variant if available.
    • pickIfDrilledDown

      public static final VariantPickingStrategy pickIfDrilledDown
      Pick best variant if not all variants are part of the result anymore, so some variants were filtered.
    • pickIfBestScored

      public static final VariantPickingStrategy pickIfBestScored
      Pick first variant, if it has a better score than the second one or if it's the only one left.
    • pickIfSingleHit

      public static final VariantPickingStrategy pickIfSingleHit
      Picks a variant only if there are no other variants matching.
  • Method Details

    • values

      public static VariantPickingStrategy[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static VariantPickingStrategy valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • apply

      public org.elasticsearch.search.SearchHit apply(org.elasticsearch.search.SearchHits variantHits, Integer allVariantHitCount)
      Specified by:
      apply in interface BiFunction<org.elasticsearch.search.SearchHits,Integer,org.elasticsearch.search.SearchHit>
    • isAllVariantHitCountRequired

      public boolean isAllVariantHitCountRequired()