/** Returns the original matching documents. */ public List<MatchingDocs> getOriginalMatchingDocs() { return super.getMatchingDocs(); }
/** Returns the original matching documents. */ public List<MatchingDocs> getOriginalMatchingDocs() { return super.getMatchingDocs(); }
/** Create {@code RangeFacetCounts}, using the provided * {@link ValueSource}, and using the provided Query as * a fastmatch: only documents passing the filter are * checked for the matching ranges. The filter must be * random access (implement {@link DocIdSet#bits}). */ public DoubleRangeFacetCounts(String field, ValueSource valueSource, FacetsCollector hits, Query fastMatchQuery, DoubleRange... ranges) throws IOException { super(field, ranges, fastMatchQuery); count(valueSource, hits.getMatchingDocs()); }
public ReducedFacetsCollector(final Collection<FacetsCollector> facetsCollectors) { final List<MatchingDocs> matchingDocs = this.getMatchingDocs(); facetsCollectors.forEach(facetsCollector -> matchingDocs.addAll(facetsCollector.getMatchingDocs())); } }
/** Create {@code TaxonomyFacetSumIntAssociations} against * the specified index field. */ public TaxonomyFacetSumIntAssociations(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config, FacetsCollector fc) throws IOException { super(indexFieldName, taxoReader, config); sumValues(fc.getMatchingDocs()); }
/** Create {@code LongRangeFacetCounts}, using the provided * {@link LongValuesSource}, and using the provided Filter as * a fastmatch: only documents passing the filter are * checked for the matching ranges, which is helpful when * the provided {@link LongValuesSource} is costly per-document, * such as a geo distance. The filter must be * random access (implement {@link DocIdSet#bits}). */ public LongRangeFacetCounts(String field, LongValuesSource valueSource, FacetsCollector hits, Query fastMatchQuery, LongRange... ranges) throws IOException { super(field, ranges, fastMatchQuery); count(valueSource, hits.getMatchingDocs()); }
/** Create {@code TaxonomyFacetSumIntAssociations} against * the specified index field. */ public TaxonomyFacetSumIntAssociations(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config, FacetsCollector fc) throws IOException { super(indexFieldName, taxoReader, config, fc); sumValues(fc.getMatchingDocs()); }
/** Create {@code FastTaxonomyFacetCounts}, using the * specified {@code indexFieldName} for ordinals. Use * this if you had set {@link * FacetsConfig#setIndexFieldName} to change the index * field name for certain dimensions. */ public FastTaxonomyFacetCounts(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config, FacetsCollector fc) throws IOException { super(indexFieldName, taxoReader, config, fc); count(fc.getMatchingDocs()); }
/** * Create {@code RangeFacetCounts}, using the provided * {@link DoubleValuesSource}, and using the provided Query as * a fastmatch: only documents matching the query are * checked for the matching ranges. */ public DoubleRangeFacetCounts(String field, DoubleValuesSource valueSource, FacetsCollector hits, Query fastMatchQuery, DoubleRange... ranges) throws IOException { super(field, ranges, fastMatchQuery); count(valueSource, hits.getMatchingDocs()); }
/** Create {@code TaxonomyFacetSumFloatAssociations} against * the specified index field. */ public TaxonomyFacetSumFloatAssociations(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config, FacetsCollector fc) throws IOException { super(indexFieldName, taxoReader, config); sumValues(fc.getMatchingDocs()); }
/** Create {@code TaxonomyFacetSumFloatAssociations} against * the specified index field. */ public TaxonomyFacetSumFloatAssociations(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config, FacetsCollector fc) throws IOException { super(indexFieldName, taxoReader, config); sumValues(fc.getMatchingDocs()); }
/** Create {@code FastTaxonomyFacetCounts}, using the * specified {@code indexFieldName} for ordinals. Use * this if you had set {@link * FacetsConfig#setIndexFieldName} to change the index * field name for certain dimensions. */ public FastTaxonomyFacetCounts(String indexFieldName, TaxonomyReader taxoReader, FacetsConfig config, FacetsCollector fc) throws IOException { super(indexFieldName, taxoReader, config); count(fc.getMatchingDocs()); }
/** Create {@code RangeFacetCounts}, using the provided * {@link ValueSource}, and using the provided Filter as * a fastmatch: only documents passing the filter are * checked for the matching ranges. The filter must be * random access (implement {@link DocIdSet#bits}). */ public LongRangeFacetCounts(String field, ValueSource valueSource, FacetsCollector hits, Query fastMatchQuery, LongRange... ranges) throws IOException { super(field, ranges, fastMatchQuery); count(valueSource, hits.getMatchingDocs()); }
/** Create {@code TaxonomyFacetCounts}, which also * counts all facet labels. Use this for a non-default * {@link OrdinalsReader}; otherwise use {@link * FastTaxonomyFacetCounts}. */ public TaxonomyFacetCounts(OrdinalsReader ordinalsReader, TaxonomyReader taxoReader, FacetsConfig config, FacetsCollector fc) throws IOException { super(ordinalsReader.getIndexFieldName(), taxoReader, config, fc); this.ordinalsReader = ordinalsReader; count(fc.getMatchingDocs()); }
/** Create {@code TaxonomyFacetCounts}, which also * counts all facet labels. Use this for a non-default * {@link OrdinalsReader}; otherwise use {@link * FastTaxonomyFacetCounts}. */ public TaxonomyFacetCounts(OrdinalsReader ordinalsReader, TaxonomyReader taxoReader, FacetsConfig config, FacetsCollector fc) throws IOException { super(ordinalsReader.getIndexFieldName(), taxoReader, config); this.ordinalsReader = ordinalsReader; count(fc.getMatchingDocs()); }
public RcIrFastTaxonomyFacetCounts(TaxonomyReader taxoReader, FacetsConfig config, FacetsCollector fc, MultiSortedDocValues groupDocValues, RcIrFacetSort sort) throws IOException { super(FacetsConfig.DEFAULT_INDEX_FIELD_NAME, taxoReader, config, fc); this.groupDocValues = groupDocValues; this.sort = sort; this.groups = new BitSet[taxoReader.getSize()]; count(fc.getMatchingDocs()); }
/** * Aggreggates float facet values from the provided * {@link DoubleValuesSource}, and pulls ordinals from the * provided {@link OrdinalsReader}. */ public TaxonomyFacetSumValueSource(OrdinalsReader ordinalsReader, TaxonomyReader taxoReader, FacetsConfig config, FacetsCollector fc, DoubleValuesSource vs) throws IOException { super(ordinalsReader.getIndexFieldName(), taxoReader, config); this.ordinalsReader = ordinalsReader; sumValues(fc.getMatchingDocs(), fc.getKeepScores(), vs); }
/** Aggreggates float facet values from the provided * {@link ValueSource}, and pulls ordinals from the * provided {@link OrdinalsReader}. */ public TaxonomyFacetSumValueSource(OrdinalsReader ordinalsReader, TaxonomyReader taxoReader, FacetsConfig config, FacetsCollector fc, ValueSource valueSource) throws IOException { super(ordinalsReader.getIndexFieldName(), taxoReader, config); this.ordinalsReader = ordinalsReader; sumValues(fc.getMatchingDocs(), fc.getKeepScores(), valueSource); }
/** Sparse faceting: returns any dimension that had any * hits, topCount labels per dimension. */ public SortedSetDocValuesFacetCounts(SortedSetDocValuesReaderState state, FacetsCollector hits) throws IOException { this.state = state; this.field = state.getField(); dv = state.getDocValues(); counts = new int[state.getSize()]; //System.out.println("field=" + field); count(hits.getMatchingDocs()); }
void filterFacets() throws IOException { List<MatchingDocs> matchingDocsList = facetsCollector.getMatchingDocs(); for (MatchingDocs matchingDocs : matchingDocsList) { DocIdSet bits = matchingDocs.bits; DocIdSetIterator docIdSetIterator = bits.iterator(); int doc = docIdSetIterator.nextDoc(); while (doc != DocIdSetIterator.NO_MORE_DOCS) { int docId = matchingDocs.context.docBase + doc; filterFacet(docId); doc = docIdSetIterator.nextDoc(); } } }