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 String
fieldName
protected static int
initialArrayLength
-
Constructor Summary
Constructors Modifier Constructor Description protected
AnalyticsField(String fieldName)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
collect(int doc)
Collect the value(s) of the wrapped field for the given document, and store the value.AnalyticsValueStream
convertToConstant()
Converts this value to aConstantValue
if it's expression type isAnalyticsValueStream.ExpressionType.CONST
.abstract void
doSetNextReader(org.apache.lucene.index.LeafReaderContext context)
Set the segment reader contextString
getExpressionStr()
Get the expression string of the analytics value stream.AnalyticsValueStream.ExpressionType
getExpressionType()
Get the type of the expression that this class represents.String
getName()
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:AnalyticsValueStream
Get 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:
getExpressionStr
in interfaceAnalyticsValueStream
- Returns:
- the name of function/value
-
getName
public String getName()
Description copied from interface:AnalyticsValueStream
Get the name of function or value.- Specified by:
getName
in interfaceAnalyticsValueStream
- Returns:
- the name of function/value
-
getExpressionType
public AnalyticsValueStream.ExpressionType getExpressionType()
Description copied from interface:AnalyticsValueStream
Get the type of the expression that this class represents.- Specified by:
getExpressionType
in interfaceAnalyticsValueStream
- Returns:
- the expression type
-
convertToConstant
public AnalyticsValueStream convertToConstant()
Description copied from interface:AnalyticsValueStream
Converts this value to aConstantValue
if 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:
convertToConstant
in interfaceAnalyticsValueStream
- Returns:
- a constant representation of this value
-
doSetNextReader
public abstract void doSetNextReader(org.apache.lucene.index.LeafReaderContext context) throws IOException
Set 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 IOException
Collect 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.
-
-