Package org.apache.solr.analytics.facet
Class PivotFacet
- java.lang.Object
-
- org.apache.solr.analytics.facet.AnalyticsFacet
-
- org.apache.solr.analytics.facet.PivotFacet
-
- All Implemented Interfaces:
StreamingFacet
public class PivotFacet extends AnalyticsFacet implements StreamingFacet
A facet that takes in multiple ValueFacet expressions and does analytics calculations over each dimension given.
-
-
Field Summary
-
Fields inherited from class org.apache.solr.analytics.facet.AnalyticsFacet
collectionManager, expressionCalculator, name, reductionData
-
-
Constructor Summary
Constructors Constructor Description PivotFacet(String name, PivotNode<?> topPivot)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFacetValueCollectionTargets()
Determine which facet values match the current document.NamedList<Object>
createOldResponse()
Create the old olap-style response of the facet to be returned in the overall analytics response.Iterable<Map<String,Object>>
createResponse()
Create the response of the facet to be returned in the overall analytics response.void
exportShardData(DataOutput output)
Export the shard data through a bit-stream, to be imported by theAnalyticsFacet.importShardData(java.io.DataInput)
method in the originating shard.void
importShardData(DataInput input)
Import the shard data from a bit-stream, exported by theAnalyticsFacet.exportShardData(java.io.DataOutput)
method in the each of the collection's shards.void
setExpressionCalculator(ExpressionCalculator expressionCalculator)
Set theExpressionCalculator
that calculates the collection of the expressions requested for this facet.void
setReductionCollectionManager(ReductionCollectionManager collectionManager)
Set theReductionCollectionManager
that manages the collection of the expressions calculated with this facet.-
Methods inherited from class org.apache.solr.analytics.facet.AnalyticsFacet
exportFacetValue, getName, importFacetValue
-
-
-
-
Method Detail
-
setReductionCollectionManager
public void setReductionCollectionManager(ReductionCollectionManager collectionManager)
Description copied from class:AnalyticsFacet
Set theReductionCollectionManager
that manages the collection of the expressions calculated with this facet.- Overrides:
setReductionCollectionManager
in classAnalyticsFacet
- Parameters:
collectionManager
- The manager for relevant expressions
-
setExpressionCalculator
public void setExpressionCalculator(ExpressionCalculator expressionCalculator)
Description copied from class:AnalyticsFacet
Set theExpressionCalculator
that calculates the collection of the expressions requested for this facet.- Overrides:
setExpressionCalculator
in classAnalyticsFacet
- Parameters:
expressionCalculator
- The calculator for relevant expressions
-
addFacetValueCollectionTargets
public void addFacetValueCollectionTargets()
Description copied from interface:StreamingFacet
Determine which facet values match the current document. Add theReductionCollectionManager.ReductionDataCollection
s of the relevant facet values to the targets of the streamingReductionCollectionManager
so that they are updated with the current document's data.- Specified by:
addFacetValueCollectionTargets
in interfaceStreamingFacet
-
importShardData
public void importShardData(DataInput input) throws IOException
Description copied from class:AnalyticsFacet
Import the shard data from a bit-stream, exported by theAnalyticsFacet.exportShardData(java.io.DataOutput)
method in the each of the collection's shards.- Overrides:
importShardData
in classAnalyticsFacet
- Parameters:
input
- The bit-stream to import the data from- Throws:
IOException
- if an exception occurs while reading from theDataInput
-
exportShardData
public void exportShardData(DataOutput output) throws IOException
Description copied from class:AnalyticsFacet
Export the shard data through a bit-stream, to be imported by theAnalyticsFacet.importShardData(java.io.DataInput)
method in the originating shard.- Overrides:
exportShardData
in classAnalyticsFacet
- Parameters:
output
- The bit-stream to output the data through- Throws:
IOException
- if an exception occurs while writing to theDataOutput
-
createOldResponse
public NamedList<Object> createOldResponse()
Description copied from class:AnalyticsFacet
Create the old olap-style response of the facet to be returned in the overall analytics response.- Overrides:
createOldResponse
in classAnalyticsFacet
- Returns:
- the response of the facet
-
createResponse
public Iterable<Map<String,Object>> createResponse()
Description copied from class:AnalyticsFacet
Create the response of the facet to be returned in the overall analytics response.- Overrides:
createResponse
in classAnalyticsFacet
- Returns:
- the response of the facet
-
-