Wraps a IndexReader and resolves ords using existing SortedSetDocValues APIs without a separate taxonomy index. This only supports flat facets (dimension + label), and it makes faceting a bit slower, adds some cost at reopen time, but avoids managing the separate taxonomy index. It also requires less RAM than the taxonomy index, as it manages the flat (2-level) hierarchy more efficiently. In addition, the tie-break during faceting is now meaningful (in label sorted order).

NOTE: creating an instance of this class is somewhat costly, as it computes per-segment ordinal maps, so you should create it once and re-use that one instance for a given IndexReader.

Exemplo n.º 1
0
 /// <summary>
 /// Sparse faceting: returns any dimension that had any
 /// hits, topCount labels per dimension.
 /// </summary>
 public SortedSetDocValuesFacetCounts(SortedSetDocValuesReaderState state, FacetsCollector hits)
 {
     this.state = state;
     this.field = state.Field;
     dv         = state.GetDocValues();
     counts     = new int[state.Count];
     //System.out.println("field=" + field);
     Count(hits.GetMatchingDocs());
 }
Exemplo n.º 2
0
 /// <summary>
 /// Create a new {@code DrillSideways} instance, where some
 ///  dimensions were indexed with {@link
 ///  SortedSetDocValuesFacetField} and others were indexed
 ///  with <seealso cref="FacetField"/>. 
 /// </summary>
 public DrillSideways(IndexSearcher searcher, FacetsConfig config, TaxonomyReader taxoReader, SortedSetDocValuesReaderState state)
 {
     this.searcher = searcher;
     this.config = config;
     this.taxoReader = taxoReader;
     this.state = state;
 }
Exemplo n.º 3
0
 /// <summary>
 /// Create a new {@code DrillSideways} instance, assuming the categories were
 ///  indexed with <seealso cref="SortedSetDocValuesFacetField"/>. 
 /// </summary>
 public DrillSideways(IndexSearcher searcher, FacetsConfig config, SortedSetDocValuesReaderState state)
     : this(searcher, config, null, state)
 {
 }