|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.lucene.facet.search.FacetsAccumulator
public abstract class FacetsAccumulator
Driver for Accumulating facets of faceted search requests over given documents.
Field Summary | |
---|---|
static double |
DEFAULT_COMPLEMENT_THRESHOLD
Default threshold for using the complements optimization. |
static double |
DISABLE_COMPLEMENT
Passing this to setComplementThreshold(double) will disable using complement optimization. |
static double |
FORCE_COMPLEMENT
Passing this to setComplementThreshold(double) will force using complement optimization. |
protected IndexReader |
indexReader
|
protected FacetSearchParams |
searchParams
|
protected TaxonomyReader |
taxonomyReader
|
Constructor Summary | |
---|---|
FacetsAccumulator(FacetSearchParams searchParams,
IndexReader indexReader,
TaxonomyReader taxonomyReader)
|
Method Summary | |
---|---|
abstract List<FacetResult> |
accumulate(ScoredDocIDs docids)
Accumulate facets over given documents, according to facet requests in effect. |
double |
getComplementThreshold()
|
protected boolean |
isAllowLabeling()
Check if labeling is allowed for this accumulator. |
protected boolean |
mayComplement()
check if all requests are complementable |
protected void |
setAllowLabeling(boolean allowLabeling)
Set whether labeling is allowed for this accumulator. |
void |
setComplementThreshold(double complementThreshold)
Set the complement threshold. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final double DEFAULT_COMPLEMENT_THRESHOLD
for more info on the complements optimization.
,
Constant Field Valuespublic static final double DISABLE_COMPLEMENT
setComplementThreshold(double)
will disable using complement optimization.
public static final double FORCE_COMPLEMENT
setComplementThreshold(double)
will force using complement optimization.
protected final TaxonomyReader taxonomyReader
protected final IndexReader indexReader
protected FacetSearchParams searchParams
Constructor Detail |
---|
public FacetsAccumulator(FacetSearchParams searchParams, IndexReader indexReader, TaxonomyReader taxonomyReader)
Method Detail |
---|
public abstract List<FacetResult> accumulate(ScoredDocIDs docids) throws IOException
docids
- documents (and their scores) for which facets are Accumulated.
IOException
- on error.public double getComplementThreshold()
setComplementThreshold(double)
public void setComplementThreshold(double complementThreshold)
Note that this optimization is only available when searching an index
whose IndexReader
implements both
IndexReader.directory()
and IndexReader.getVersion()
otherwise the optimization is silently disabled regardless of
the complement threshold settings.
For the default settings see DEFAULT_COMPLEMENT_THRESHOLD
.
To forcing complements in all cases pass FORCE_COMPLEMENT
.
This is mostly useful for testing purposes, as forcing complements when only
tiny fraction of available documents match the query does not make sense and
would incur performance degradations.
To disable complements pass DISABLE_COMPLEMENT
.
complementThreshold
- the complement threshold to setprotected boolean isAllowLabeling()
By default labeling is allowed. This allows one accumulator to invoke other accumulators for accumulation but keep to itself the responsibility of labeling. This might br handy since labeling is a costly operation.
setAllowLabeling(boolean)
protected void setAllowLabeling(boolean allowLabeling)
allowLabeling
- new setting for allow labelingisAllowLabeling()
protected boolean mayComplement()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |