@Beta public class ArrayAtLookup extends DocumentValue
GroupingExpression
.
The first argument should be the name of an array attribute in the
input Hit
, 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?).Modifier and Type | Field and Description |
---|---|
private GroupingExpression |
arg2 |
private String |
attributeName |
Constructor and Description |
---|
ArrayAtLookup(String attributeName,
GroupingExpression indexArg)
Constructs a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
String |
getAttributeName()
Returns the name of the attribute to retrieve from the input hit.
|
GroupingExpression |
getIndexArgument()
get the expression to evaluate before indexing
|
resolveLevel
asImage, asString, getLevel, setLabel, visit
getLabel, toString
private final String attributeName
private final GroupingExpression arg2
public ArrayAtLookup(String attributeName, GroupingExpression indexArg)
attributeName
- The attribute name to assign to this.public String getAttributeName()
public GroupingExpression getIndexArgument()
Copyright © 2017. All rights reserved.