Class AnalyticsField
- java.lang.Object
-
- org.apache.solr.analytics.function.field.AnalyticsField
-
- All Implemented Interfaces:
AnalyticsValueStream
- Direct Known Subclasses:
BooleanField,BooleanMultiField,DateField,DoubleField,DoubleMultiPointField,DoubleMultiTrieField,FloatField,FloatMultiPointField,FloatMultiTrieField,IntField,IntMultiPointField,IntMultiTrieField,LongField,LongMultiPointField,LongMultiTrieField,StringField,StringMultiField
public abstract class AnalyticsField extends Object implements AnalyticsValueStream
An analytics wrapper for Solr Fields. Currently only fields with Doc Values enabled can be used in Analytics queries.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.solr.analytics.value.AnalyticsValueStream
AnalyticsValueStream.AbstractAnalyticsValueStream, AnalyticsValueStream.ExpressionType
-
-
Field Summary
Fields Modifier and Type Field Description protected StringfieldNameprotected static intinitialArrayLength
-
Constructor Summary
Constructors Modifier Constructor Description protectedAnalyticsField(String fieldName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidcollect(int doc)Collect the value(s) of the wrapped field for the given document, and store the value.AnalyticsValueStreamconvertToConstant()Converts this value to aConstantValueif it's expression type isAnalyticsValueStream.ExpressionType.CONST.abstract voiddoSetNextReader(org.apache.lucene.index.LeafReaderContext context)Set the segment reader contextStringgetExpressionStr()Get the expression string of the analytics value stream.AnalyticsValueStream.ExpressionTypegetExpressionType()Get the type of the expression that this class represents.StringgetName()Get the name of function or value.-
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.AnalyticsValueStream
streamObjects
-
-
-
-
Field Detail
-
initialArrayLength
protected static final int initialArrayLength
- See Also:
- Constant Field Values
-
fieldName
protected final String fieldName
-
-
Constructor Detail
-
AnalyticsField
protected AnalyticsField(String fieldName)
-
-
Method Detail
-
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
-
convertToConstant
public AnalyticsValueStream convertToConstant()
Description copied from interface:AnalyticsValueStreamConverts this value to aConstantValueif it's expression type isAnalyticsValueStream.ExpressionType.CONST. If the value is reduced then no conversion will occur and the value itself will be returned.- Specified by:
convertToConstantin interfaceAnalyticsValueStream- Returns:
- a constant representation of this value
-
doSetNextReader
public abstract void doSetNextReader(org.apache.lucene.index.LeafReaderContext context) throws IOExceptionSet the segment reader context- Parameters:
context- segment context- Throws:
IOException- if an error occurs while loading the leaf reader
-
collect
public abstract void collect(int doc) throws IOExceptionCollect the value(s) of the wrapped field for the given document, and store the value.- Parameters:
doc- ID of the document to collect- Throws:
IOException- if an error occurs while reading the document.
-
-