org.apache.lucene.facet.search
public class TopKFacetResultsHandler extends PartitionsFacetResultsHandler
FacetRequest. K is global
(among all results) and is defined by FacetRequest.numResults.facetArrays, facetRequest, resolver, taxonomyReader| Constructor and Description |
|---|
TopKFacetResultsHandler(TaxonomyReader taxonomyReader,
FacetRequest facetRequest,
OrdinalValueResolver resolver,
FacetArrays facetArrays)
Construct top-K results handler.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
labelResult(FacetResult facetResult)
Label results according to settings in
FacetRequest, such as
FacetRequest.getNumLabel(). |
IntermediateFacetResult |
mergeResults(IntermediateFacetResult... tmpResults)
Merge results of several facet partitions.
|
FacetResult |
rearrangeFacetResult(FacetResult facetResult)
Perform any rearrangement as required on a facet result that has changed after
it was rendered.
|
FacetResult |
renderFacetResult(IntermediateFacetResult tmpResult)
Create a facet result from the temporary result.
|
compute, isSelfPartitionpublic TopKFacetResultsHandler(TaxonomyReader taxonomyReader, FacetRequest facetRequest, OrdinalValueResolver resolver, FacetArrays facetArrays)
public IntermediateFacetResult fetchPartitionResult(int offset) throws IOException
PartitionsFacetResultsHandlerfetchPartitionResult in class PartitionsFacetResultsHandleroffset - offset in input arrays where partition startsfacetRequest, requests an
illegal FacetResult, like, e.g., a root node category path that
does not exist in constructor parameter taxonomyReader
.IOException - on errorpublic IntermediateFacetResult mergeResults(IntermediateFacetResult... tmpResults) throws IOException
PartitionsFacetResultsHandlerIntermediateFacetResult 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.mergeResults in class PartitionsFacetResultsHandlertmpResults - one or more temporary results created by this
handler.IOException - on error.IntermediateFacetResult.getFacetRequest()public FacetResult renderFacetResult(IntermediateFacetResult tmpResult)
PartitionsFacetResultsHandlerrenderFacetResult in class PartitionsFacetResultsHandlertmpResult - temporary result to be rendered as a FacetResultpublic FacetResult rearrangeFacetResult(FacetResult facetResult)
PartitionsFacetResultsHandlerPossible 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.
rearrangeFacetResult in class PartitionsFacetResultsHandlerfacetResult - result to be rearranged.FacetResultNode.valuepublic void labelResult(FacetResult facetResult) throws IOException
PartitionsFacetResultsHandlerFacetRequest, such as
FacetRequest.getNumLabel(). Usually invoked by
OldFacetsAccumulator.accumulate(ScoredDocIDs)labelResult in class PartitionsFacetResultsHandlerfacetResult - facet result to be labeled.IOException - on errorCopyright © 2000-2014 Apache Software Foundation. All Rights Reserved.