Class CountFunction
- java.lang.Object
-
- org.apache.solr.analytics.value.LongValue.AbstractLongValue
-
- org.apache.solr.analytics.function.reduction.CountFunction
-
- All Implemented Interfaces:
ReductionFunction,AnalyticsValue,AnalyticsValueStream,ComparableValue,DoubleValue,DoubleValueStream,LongValue,LongValue.CastingLongValue,LongValueStream,StringValue,StringValueStream
public class CountFunction extends LongValue.AbstractLongValue implements ReductionFunction
A reduction function which either counts the number of values that the parameter expression contains, or the number of documents returned if no parameter is given.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.AnalyticsValue
AnalyticsValue.AbstractAnalyticsValue
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.AnalyticsValueStream
AnalyticsValueStream.AbstractAnalyticsValueStream, AnalyticsValueStream.ExpressionType
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.DoubleValue
DoubleValue.AbstractDoubleValue, DoubleValue.CastingDoubleValue
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.DoubleValueStream
DoubleValueStream.AbstractDoubleValueStream, DoubleValueStream.CastingDoubleValueStream
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.LongValue
LongValue.AbstractLongValue, LongValue.CastingLongValue
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.LongValueStream
LongValueStream.AbstractLongValueStream, LongValueStream.CastingLongValueStream
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.StringValue
StringValue.AbstractStringValue, StringValue.CastingStringValue
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.StringValueStream
StringValueStream.AbstractStringValueStream, StringValueStream.CastingStringValueStream
-
-
Field Summary
Fields Modifier and Type Field Description static ExpressionFactory.CreatorFunctioncreatorFunctionstatic Stringname
-
Constructor Summary
Constructors Constructor Description CountFunction()CountFunction(AnalyticsValueStream param)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanexists()Check whether the current value exists.StringgetExpressionStr()Get the expression string of the analytics value stream.AnalyticsValueStream.ExpressionTypegetExpressionType()Get the type of the expression that this class represents.longgetLong()Get the long representation of the current value.StringgetName()Get the name of function or value.voidsynchronizeDataCollectors(UnaryOperator<ReductionDataCollector<?>> sync)Syncs the data collectors with shared versions across the entire Analytics Request so that as little data as possible is sent across shards.-
Methods inherited from class org.apache.solr.analytics.value.LongValue.AbstractLongValue
convertToConstant, getDouble, getObject, getObjectComparator, getString, streamDoubles, streamLongs, streamObjects, streamStrings
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.solr.analytics.value.AnalyticsValue
getObject
-
Methods inherited from interface org.apache.solr.analytics.value.AnalyticsValueStream
convertToConstant, streamObjects
-
-
-
-
Field Detail
-
name
public static final String name
- See Also:
- Constant Field Values
-
creatorFunction
public static final ExpressionFactory.CreatorFunction creatorFunction
-
-
Constructor Detail
-
CountFunction
public CountFunction()
-
CountFunction
public CountFunction(AnalyticsValueStream param)
-
-
Method Detail
-
getLong
public long getLong()
Description copied from interface:LongValueGet the long representation of the current value.NOTE: The value returned is not valid unless calling
AnalyticsValue.exists()afterwards returnsTRUE.
-
exists
public boolean exists()
Description copied from interface:AnalyticsValueCheck whether the current value exists.
NOTE: The result of this method is only guaranteed after anyget<Type>()method is called.- Specified by:
existsin interfaceAnalyticsValue- Returns:
- whether the current value exists
-
synchronizeDataCollectors
public void synchronizeDataCollectors(UnaryOperator<ReductionDataCollector<?>> sync)
Description copied from interface:ReductionFunctionSyncs the data collectors with shared versions across the entire Analytics Request so that as little data as possible is sent across shards.- Specified by:
synchronizeDataCollectorsin interfaceReductionFunction- Parameters:
sync- a function that takes in aReductionDataCollectorand returns a shared version
-
getExpressionStr
public String getExpressionStr()
Description copied from interface:AnalyticsValueStreamGet the expression string of the analytics value stream. Must be unique to the expression. If passed toExpressionFactory.createExpression(String), the exact same expression should be created.- Specified by:
getExpressionStrin interfaceAnalyticsValueStream- Returns:
- the name of function/value
-
getName
public String getName()
Description copied from interface:AnalyticsValueStreamGet the name of function or value.- Specified by:
getNamein interfaceAnalyticsValueStream- Returns:
- the name of function/value
-
getExpressionType
public AnalyticsValueStream.ExpressionType getExpressionType()
Description copied from interface:AnalyticsValueStreamGet the type of the expression that this class represents.- Specified by:
getExpressionTypein interfaceAnalyticsValueStream- Returns:
- the expression type
-
-