public class DrillSideways extends Object
DrillDownQuery
. Drill sideways counts include
alternative values/aggregates for the drill-down
dimensions so that a dimension does not disappear after
the user drills down into it.
Use one of the static search
methods to do the search, and then get the hits and facet
results from the returned DrillSideways.DrillSidewaysResult
.
NOTE: this allocates one FacetsCollector
for each drill-down, plus one. If your
index has high number of facet labels then this will
multiply your memory usage.
Modifier and Type | Class and Description |
---|---|
static class |
DrillSideways.ConcurrentDrillSidewaysResult<R>
|
static class |
DrillSideways.DrillSidewaysResult
|
Modifier and Type | Field and Description |
---|---|
protected FacetsConfig |
config
FacetsConfig passed to constructor. |
protected IndexSearcher |
searcher
IndexSearcher passed to constructor. |
protected SortedSetDocValuesReaderState |
state
SortedSetDocValuesReaderState passed to
constructor; can be null. |
protected TaxonomyReader |
taxoReader
TaxonomyReader passed to constructor. |
Constructor and Description |
---|
DrillSideways(IndexSearcher searcher,
FacetsConfig config,
SortedSetDocValuesReaderState state)
Create a new
DrillSideways instance, assuming the categories were
indexed with SortedSetDocValuesFacetField . |
DrillSideways(IndexSearcher searcher,
FacetsConfig config,
TaxonomyReader taxoReader)
Create a new
DrillSideways instance. |
DrillSideways(IndexSearcher searcher,
FacetsConfig config,
TaxonomyReader taxoReader,
SortedSetDocValuesReaderState state)
Create a new
DrillSideways instance, where some
dimensions were indexed with SortedSetDocValuesFacetField and others were indexed
with FacetField . |
DrillSideways(IndexSearcher searcher,
FacetsConfig config,
TaxonomyReader taxoReader,
SortedSetDocValuesReaderState state,
ExecutorService executor)
Create a new
DrillSideways instance, where some
dimensions were indexed with SortedSetDocValuesFacetField and others were indexed
with FacetField . |
Modifier and Type | Method and Description |
---|---|
protected Facets |
buildFacetsResult(FacetsCollector drillDowns,
FacetsCollector[] drillSideways,
String[] drillSidewaysDims)
Subclass can override to customize per-dim Facets
impl.
|
protected boolean |
scoreSubDocsAtOnce()
Override this and return true if your collector
(e.g.,
ToParentBlockJoinCollector ) expects all
sub-scorers to be positioned on the document being
collected. |
DrillSideways.DrillSidewaysResult |
search(DrillDownQuery query,
Collector hitCollector)
Search, collecting hits with a
Collector , and
computing drill down and sideways counts. |
<R> DrillSideways.ConcurrentDrillSidewaysResult<R> |
search(DrillDownQuery query,
CollectorManager<?,R> hitCollectorManager)
Runs a search, using a
CollectorManager to gather and merge search results |
DrillSideways.DrillSidewaysResult |
search(DrillDownQuery query,
int topN)
Search, sorting by score, and computing
drill down and sideways counts.
|
DrillSideways.DrillSidewaysResult |
search(DrillDownQuery query,
Query filter,
FieldDoc after,
int topN,
Sort sort,
boolean doDocScores)
Search, sorting by
Sort , and computing
drill down and sideways counts. |
DrillSideways.DrillSidewaysResult |
search(ScoreDoc after,
DrillDownQuery query,
int topN)
Search, sorting by score, and computing
drill down and sideways counts.
|
protected final IndexSearcher searcher
IndexSearcher
passed to constructor.protected final TaxonomyReader taxoReader
TaxonomyReader
passed to constructor.protected final SortedSetDocValuesReaderState state
SortedSetDocValuesReaderState
passed to
constructor; can be null.protected final FacetsConfig config
FacetsConfig
passed to constructor.public DrillSideways(IndexSearcher searcher, FacetsConfig config, TaxonomyReader taxoReader)
DrillSideways
instance.public DrillSideways(IndexSearcher searcher, FacetsConfig config, SortedSetDocValuesReaderState state)
DrillSideways
instance, assuming the categories were
indexed with SortedSetDocValuesFacetField
.public DrillSideways(IndexSearcher searcher, FacetsConfig config, TaxonomyReader taxoReader, SortedSetDocValuesReaderState state)
DrillSideways
instance, where some
dimensions were indexed with SortedSetDocValuesFacetField
and others were indexed
with FacetField
.public DrillSideways(IndexSearcher searcher, FacetsConfig config, TaxonomyReader taxoReader, SortedSetDocValuesReaderState state, ExecutorService executor)
DrillSideways
instance, where some
dimensions were indexed with SortedSetDocValuesFacetField
and others were indexed
with FacetField
.
Use this constructor to use the concurrent implementation and/or the CollectorManager
protected Facets buildFacetsResult(FacetsCollector drillDowns, FacetsCollector[] drillSideways, String[] drillSidewaysDims) throws IOException
IOException
public DrillSideways.DrillSidewaysResult search(DrillDownQuery query, Collector hitCollector) throws IOException
Collector
, and
computing drill down and sideways counts.IOException
public DrillSideways.DrillSidewaysResult search(DrillDownQuery query, Query filter, FieldDoc after, int topN, Sort sort, boolean doDocScores) throws IOException
Sort
, and computing
drill down and sideways counts.IOException
public DrillSideways.DrillSidewaysResult search(DrillDownQuery query, int topN) throws IOException
IOException
public DrillSideways.DrillSidewaysResult search(ScoreDoc after, DrillDownQuery query, int topN) throws IOException
IOException
protected boolean scoreSubDocsAtOnce()
ToParentBlockJoinCollector
) expects all
sub-scorers to be positioned on the document being
collected. This will cause some performance loss;
default is false.public <R> DrillSideways.ConcurrentDrillSidewaysResult<R> search(DrillDownQuery query, CollectorManager<?,R> hitCollectorManager) throws IOException
CollectorManager
to gather and merge search resultsIOException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.