|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.lucene.facet.search.FacetResultsHandler
org.apache.lucene.facet.search.TopKFacetResultsHandler
public class TopKFacetResultsHandler
Generate Top-K results for a particular FacetRequest.
K is global (among all results) and is defined by FacetRequest.getNumResults().
Note: Values of 0 (Zero) are ignored by this results handler.
| Field Summary |
|---|
| Fields inherited from class org.apache.lucene.facet.search.FacetResultsHandler |
|---|
facetRequest, taxonomyReader |
| Constructor Summary | |
|---|---|
TopKFacetResultsHandler(TaxonomyReader taxonomyReader,
FacetRequest facetRequest)
Construct top-K results handler. |
|
| Method Summary | |
|---|---|
IntermediateFacetResult |
fetchPartitionResult(FacetArrays facetArrays,
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. |
| Methods inherited from class org.apache.lucene.facet.search.FacetResultsHandler |
|---|
getFacetRequest, getTaxonomyReader, isSelfPartition |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TopKFacetResultsHandler(TaxonomyReader taxonomyReader,
FacetRequest facetRequest)
taxonomyReader - taxonomy readerfacetRequest - facet request being served| Method Detail |
|---|
public IntermediateFacetResult fetchPartitionResult(FacetArrays facetArrays,
int offset)
throws IOException
FacetResultsHandler
fetchPartitionResult in class FacetResultsHandlerfacetArrays - facet arrays for the certain partitionoffset - 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 error
public IntermediateFacetResult mergeResults(IntermediateFacetResult... tmpResults)
throws IOException
FacetResultsHandlerIntermediateFacetResult 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 FacetResultsHandlertmpResults - one or more temporary results created by this
handler.
IOException - on error.IntermediateFacetResult.getFacetRequest()public FacetResult renderFacetResult(IntermediateFacetResult tmpResult)
FacetResultsHandler
renderFacetResult in class FacetResultsHandlertmpResult - temporary result to be rendered as a FacetResultpublic FacetResult rearrangeFacetResult(FacetResult facetResult)
FacetResultsHandlerPossible 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 FacetResultsHandlerfacetResult - result to be rearranged.FacetResultNode.setValue(double)
public void labelResult(FacetResult facetResult)
throws IOException
FacetResultsHandlerFacetRequest,
such as FacetRequest.getNumLabel().
Usually invoked by FacetsAccumulator.accumulate(ScoredDocIDs)
labelResult in class FacetResultsHandlerfacetResult - facet result to be labeled.
IOException - on error
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||