Package de.cxp.ocs.elasticsearch.mapper
Enum Class 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.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionpick first variant if available.Pick first variant, if it has a better score than the second one or if it's the only one left.Pick best variant if not all variants are part of the result anymore, so some variants were filtered.Picks a variant only if there are no other variants matching. -
Method Summary
Modifier and TypeMethodDescriptionorg.elasticsearch.search.SearchHit
boolean
static VariantPickingStrategy
Returns the enum constant of this class with the specified name.static VariantPickingStrategy[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
Methods inherited from interface java.util.function.BiFunction
andThen
-
Enum Constant Details
-
pickAlways
pick first variant if available. -
pickIfDrilledDown
Pick best variant if not all variants are part of the result anymore, so some variants were filtered. -
pickIfBestScored
Pick first variant, if it has a better score than the second one or if it's the only one left. -
pickIfSingleHit
Picks a variant only if there are no other variants matching.
-
-
Method Details
-
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
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 nameNullPointerException
- if the argument is null
-
apply
public org.elasticsearch.search.SearchHit apply(org.elasticsearch.search.SearchHits variantHits, Integer allVariantHitCount) - Specified by:
apply
in interfaceBiFunction<org.elasticsearch.search.SearchHits,
Integer, org.elasticsearch.search.SearchHit>
-
isAllVariantHitCountRequired
public boolean isAllVariantHitCountRequired()
-