Class ArrayAtLookup
- java.lang.Object
-
- com.yahoo.search.grouping.request.GroupingNode
-
- com.yahoo.search.grouping.request.GroupingExpression
-
- com.yahoo.search.grouping.request.DocumentValue
-
- com.yahoo.search.grouping.request.ArrayAtLookup
-
public class ArrayAtLookup extends DocumentValue
Represents access of array element in a document attribute in aGroupingExpression
. The first argument should be the name of an array attribute in the inputHit
, while the second argument is evaluated as an integer and used as the index in that array. If the index argument is less than 0 returns the first array element; if the index is greater than or equal to size(array) returns the last array element; if the array is empty returns 0 (or NaN?).- Author:
- arnej27959
-
-
Constructor Summary
Constructors Constructor Description ArrayAtLookup(String attributeName, GroupingExpression indexArg)
Constructs a new instance of this class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ArrayAtLookup
copy()
Returns a deep copy of thisString
getAttributeName()
Returns the name of the attribute to retrieve from the input hitGroupingExpression
getIndexArgument()
Return the expression to evaluate before indexing-
Methods inherited from class com.yahoo.search.grouping.request.DocumentValue
resolveLevel
-
Methods inherited from class com.yahoo.search.grouping.request.GroupingExpression
asImage, asString, getLevel, getLevelOrNull, setLabel, visit
-
Methods inherited from class com.yahoo.search.grouping.request.GroupingNode
getImage, getLabel, toString
-
-
-
-
Constructor Detail
-
ArrayAtLookup
public ArrayAtLookup(String attributeName, GroupingExpression indexArg)
Constructs a new instance of this class.- Parameters:
attributeName
- the attribute name to assign to this.
-
-
Method Detail
-
copy
public ArrayAtLookup copy()
Description copied from class:GroupingExpression
Returns a deep copy of this- Specified by:
copy
in classGroupingExpression
-
getAttributeName
public String getAttributeName()
Returns the name of the attribute to retrieve from the input hit
-
getIndexArgument
public GroupingExpression getIndexArgument()
Return the expression to evaluate before indexing
-
-