|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.facet.search.FacetResultsHandler org.apache.lucene.facet.partitions.PartitionsFacetResultsHandler
public abstract class PartitionsFacetResultsHandler
A FacetResultsHandler
designed to work with facet partitions.
Field Summary |
---|
Fields inherited from class org.apache.lucene.facet.search.FacetResultsHandler |
---|
facetArrays, facetRequest, taxonomyReader |
Constructor Summary | |
---|---|
PartitionsFacetResultsHandler(TaxonomyReader taxonomyReader,
FacetRequest facetRequest,
FacetArrays facetArrays)
|
Method Summary | |
---|---|
FacetResult |
compute()
Computes the FacetResult for the given FacetArrays . |
abstract IntermediateFacetResult |
fetchPartitionResult(int offset)
Fetch results of a single partition, given facet arrays for that partition, and based on the matching documents and faceted search parameters. |
protected boolean |
isSelfPartition(int ordinal,
FacetArrays facetArrays,
int offset)
Check if an array contains the partition which contains ordinal |
abstract void |
labelResult(FacetResult facetResult)
Label results according to settings in FacetRequest , such as
FacetRequest.getNumLabel() . |
abstract IntermediateFacetResult |
mergeResults(IntermediateFacetResult... tmpResults)
Merge results of several facet partitions. |
abstract FacetResult |
rearrangeFacetResult(FacetResult facetResult)
Perform any rearrangement as required on a facet result that has changed after it was rendered. |
abstract FacetResult |
renderFacetResult(IntermediateFacetResult tmpResult)
Create a facet result from the temporary result. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PartitionsFacetResultsHandler(TaxonomyReader taxonomyReader, FacetRequest facetRequest, FacetArrays facetArrays)
Method Detail |
---|
public abstract IntermediateFacetResult fetchPartitionResult(int offset) throws IOException
offset
- offset in input arrays where partition starts
facetRequest
, requests an
illegal FacetResult, like, e.g., a root node category path that
does not exist in constructor parameter taxonomyReader
.
IOException
- on errorpublic abstract IntermediateFacetResult mergeResults(IntermediateFacetResult... tmpResults) throws IOException
IntermediateFacetResult
must be ones
that were created by this handler otherwise a ClassCastException
is
thrown. In addition, all passed IntermediateFacetResult
must have
the same FacetRequest
otherwise an IllegalArgumentException
is thrown.
tmpResults
- one or more temporary results created by this
handler.
IOException
- on error.
ClassCastException
- if the temporary result passed was not created
by this handler
IllegalArgumentException
- if passed facetResults
do not
have the same FacetRequest
IntermediateFacetResult.getFacetRequest()
public abstract FacetResult renderFacetResult(IntermediateFacetResult tmpResult) throws IOException
tmpResult
- temporary result to be rendered as a FacetResult
IOException
- on error.public abstract FacetResult rearrangeFacetResult(FacetResult facetResult)
Possible use case: a sampling facets accumulator invoked another other facets accumulator on a sample set of documents, obtained rendered facet results, fixed their counts, and now it is needed to sort the results differently according to the fixed counts.
facetResult
- result to be rearranged.FacetResultNode.value
public abstract void labelResult(FacetResult facetResult) throws IOException
FacetRequest
, such as
FacetRequest.getNumLabel()
. Usually invoked by
StandardFacetsAccumulator.accumulate(ScoredDocIDs)
facetResult
- facet result to be labeled.
IOException
- on errorprotected boolean isSelfPartition(int ordinal, FacetArrays facetArrays, int offset)
ordinal
- checked facetfacetArrays
- facet arrays for the certain partitionoffset
- offset in input arrays where partition startspublic final FacetResult compute() throws IOException
FacetResultsHandler
FacetResult
for the given FacetArrays
.
compute
in class FacetResultsHandler
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |