Class DrillSideways
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.
There is both a "standard" and "concurrent" implementation for drill sideways. The concurrent
approach is enabled by providing an ExecutorService to the ctor. The concurrent
implementation may be a little faster but does duplicate work (which grows linearly with the
number of drill down dimensions specified on the provided DrillDownQuery). The duplicate
work may impact the overall throughput of a system. The standard approach may be a little slower
but avoids duplicate computations and query processing. Note that both approaches are compatible
with concurrent searching across segments (i.e., if using an IndexSearcher constructed
with an Executor).
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.
- WARNING: This API is experimental and might change in incompatible ways in the next release.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FacetsConfigFacetsConfigpassed to constructor.protected final IndexSearcherIndexSearcherpassed to constructor.protected final SortedSetDocValuesReaderStateSortedSetDocValuesReaderStatepassed to constructor; can be null.protected final TaxonomyReaderTaxonomyReaderpassed to constructor. -
Constructor Summary
ConstructorsConstructorDescriptionDrillSideways(IndexSearcher searcher, FacetsConfig config, SortedSetDocValuesReaderState state) Create a newDrillSidewaysinstance, assuming the categories were indexed withSortedSetDocValuesFacetField.DrillSideways(IndexSearcher searcher, FacetsConfig config, TaxonomyReader taxoReader) Create a newDrillSidewaysinstance.DrillSideways(IndexSearcher searcher, FacetsConfig config, TaxonomyReader taxoReader, SortedSetDocValuesReaderState state) Create a newDrillSidewaysinstance, where some dimensions were indexed withSortedSetDocValuesFacetFieldand others were indexed withFacetField.DrillSideways(IndexSearcher searcher, FacetsConfig config, TaxonomyReader taxoReader, SortedSetDocValuesReaderState state, ExecutorService executor) Create a newDrillSidewaysinstance, where some dimensions were indexed withSortedSetDocValuesFacetFieldand others were indexed withFacetField. -
Method Summary
Modifier and TypeMethodDescriptionprotected FacetsbuildFacetsResult(FacetsCollector drillDowns, FacetsCollector[] drillSideways, String[] drillSidewaysDims) Subclass can override to customize per-dim Facets impl.protected FacetsCollectorSubclass can override to customize drill down facets collector.protected FacetsCollectorManagerSubclass can override to customize drill down facets collector.protected booleanOverride this and return true if your collector (e.g.,ToParentBlockJoinCollector) expects all sub-scorers to be positioned on the document being collected.search(DrillDownQuery query, int topN) Search, sorting by score, and computing drill down and sideways counts.search(DrillDownQuery query, Collector hitCollector) Deprecated.search(DrillDownQuery query, CollectorManager<?, R> hitCollectorManager) Runs a search, using aCollectorManagerto gather and merge search resultssearch(DrillDownQuery query, Query filter, FieldDoc after, int topN, Sort sort, boolean doDocScores) Search, sorting bySort, and computing drill down and sideways counts.search(ScoreDoc after, DrillDownQuery query, int topN) Search, sorting by score, and computing drill down and sideways counts.
-
Field Details
-
searcher
IndexSearcherpassed to constructor. -
taxoReader
TaxonomyReaderpassed to constructor. -
state
SortedSetDocValuesReaderStatepassed to constructor; can be null. -
config
FacetsConfigpassed to constructor.
-
-
Constructor Details
-
DrillSideways
Create a newDrillSidewaysinstance. -
DrillSideways
public DrillSideways(IndexSearcher searcher, FacetsConfig config, SortedSetDocValuesReaderState state) Create a newDrillSidewaysinstance, assuming the categories were indexed withSortedSetDocValuesFacetField. -
DrillSideways
public DrillSideways(IndexSearcher searcher, FacetsConfig config, TaxonomyReader taxoReader, SortedSetDocValuesReaderState state) Create a newDrillSidewaysinstance, where some dimensions were indexed withSortedSetDocValuesFacetFieldand others were indexed withFacetField. -
DrillSideways
public DrillSideways(IndexSearcher searcher, FacetsConfig config, TaxonomyReader taxoReader, SortedSetDocValuesReaderState state, ExecutorService executor) Create a newDrillSidewaysinstance, where some dimensions were indexed withSortedSetDocValuesFacetFieldand others were indexed withFacetField.Use this constructor to use the concurrent implementation
-
-
Method Details
-
createDrillDownFacetsCollector
Subclass can override to customize drill down facets collector. Returningnullis valid if no drill down facet collection is needed. -
createDrillDownFacetsCollectorManager
Subclass can override to customize drill down facets collector. Returningnullis valid if no drill down facet collection is needed. -
buildFacetsResult
protected Facets buildFacetsResult(FacetsCollector drillDowns, FacetsCollector[] drillSideways, String[] drillSidewaysDims) throws IOException Subclass can override to customize per-dim Facets impl.- Throws:
IOException
-
search
@Deprecated public DrillSideways.DrillSidewaysResult search(DrillDownQuery query, Collector hitCollector) throws IOException Deprecated.This method is deprecated in interest of thesearch(DrillDownQuery, CollectorManager)method.Search, collecting hits with aCollector, and computing drill down and sideways counts.Note that "concurrent" drill sideways will not be invoked here, even if an
ExecutorServicewas supplied to the ctor, sinceCollectors are not thread-safe. If interested in concurrent drill sideways, please use one of the other staticsearchmethods.- Throws:
IOException
-
search
public DrillSideways.DrillSidewaysResult search(DrillDownQuery query, Query filter, FieldDoc after, int topN, Sort sort, boolean doDocScores) throws IOException Search, sorting bySort, and computing drill down and sideways counts.- Throws:
IOException
-
search
Search, sorting by score, and computing drill down and sideways counts.- Throws:
IOException
-
search
public DrillSideways.DrillSidewaysResult search(ScoreDoc after, DrillDownQuery query, int topN) throws IOException Search, sorting by score, and computing drill down and sideways counts.- Throws:
IOException
-
scoreSubDocsAtOnce
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. This will cause some performance loss; default is false. -
search
public <R> DrillSideways.ConcurrentDrillSidewaysResult<R> search(DrillDownQuery query, CollectorManager<?, R> hitCollectorManager) throws IOExceptionRuns a search, using aCollectorManagerto gather and merge search results- Throws:
IOException
-
search(DrillDownQuery, CollectorManager)method.