public long globalMaxOrd(IndexSearcher indexSearcher) throws IOException { IndexReader indexReader = indexSearcher.getIndexReader(); if (indexReader.leaves().isEmpty()) { return 0; } else { LeafReaderContext atomicReaderContext = indexReader.leaves().get(0); SortedSetDocValues values = globalOrdinalsValues(atomicReaderContext); return values.getValueCount(); } }
public GlobalOrdinalsStringTermsAggregator(String name, AggregatorFactories factories, ValuesSource.Bytes.WithOrdinals valuesSource, BucketOrder order, DocValueFormat format, BucketCountThresholds bucketCountThresholds, IncludeExclude.OrdinalsFilter includeExclude, SearchContext context, Aggregator parent, boolean remapGlobalOrds, SubAggCollectionMode collectionMode, boolean showTermDocCountError, List<PipelineAggregator> pipelineAggregators, Map<String, Object> metaData) throws IOException { super(name, factories, context, parent, order, format, bucketCountThresholds, collectionMode, showTermDocCountError, pipelineAggregators, metaData); this.valuesSource = valuesSource; this.includeExclude = includeExclude; final IndexReader reader = context.searcher().getIndexReader(); final SortedSetDocValues values = reader.leaves().size() > 0 ? valuesSource.globalOrdinalsValues(context.searcher().getIndexReader().leaves().get(0)) : DocValues.emptySortedSet(); this.valueCount = values.getValueCount(); this.lookupGlobalOrd = values::lookupOrd; this.acceptedGlobalOrdinals = includeExclude != null ? includeExclude.acceptedGlobalOrdinals(values) : null; this.bucketOrds = remapGlobalOrds ? new LongHash(1, context.bigArrays()) : null; }
public long globalMaxOrd(IndexSearcher indexSearcher) throws IOException { IndexReader indexReader = indexSearcher.getIndexReader(); if (indexReader.leaves().isEmpty()) { return 0; } else { LeafReaderContext atomicReaderContext = indexReader.leaves().get(0); SortedSetDocValues values = globalOrdinalsValues(atomicReaderContext); return values.getValueCount(); } }
private SortedSetDocValues getGlobalOrds(LeafReaderContext ctx) throws IOException { return acceptedGlobalOrdinals == null ? valuesSource.globalOrdinalsValues(ctx) : new FilteredOrdinals(valuesSource.globalOrdinalsValues(ctx), acceptedGlobalOrdinals); }
private SortedSetDocValues getGlobalOrds(LeafReaderContext ctx) throws IOException { return acceptedGlobalOrdinals == null ? valuesSource.globalOrdinalsValues(ctx) : new FilteredOrdinals(valuesSource.globalOrdinalsValues(ctx), acceptedGlobalOrdinals); }
private RandomAccessOrds getGlobalOrds(LeafReaderContext ctx) throws IOException { return acceptedGlobalOrdinals == null ? valuesSource.globalOrdinalsValues(ctx) : new FilteredOrdinals(valuesSource.globalOrdinalsValues(ctx), acceptedGlobalOrdinals); }
public long globalMaxOrd(IndexSearcher indexSearcher) { IndexReader indexReader = indexSearcher.getIndexReader(); if (indexReader.leaves().isEmpty()) { return 0; } else { LeafReaderContext atomicReaderContext = indexReader.leaves().get(0); RandomAccessOrds values = globalOrdinalsValues(atomicReaderContext); return values.getValueCount(); } }
@Override public LongUnaryOperator globalOrdinalsMapping(LeafReaderContext context) throws IOException { return getGlobalMapping(valuesSource.ordinalsValues(context), valuesSource.globalOrdinalsValues(context), valuesSource.globalOrdinalsMapping(context), missing); } };
@Override public LeafBucketCollector getLeafCollector(LeafReaderContext ctx, final LeafBucketCollector sub) throws IOException { if (segmentOrds != null) { mapSegmentCountsToGlobalCounts(); } globalOrds = valuesSource.globalOrdinalsValues(ctx); segmentOrds = valuesSource.ordinalsValues(ctx); return newCollector(segmentOrds, sub); }
@Override public RandomAccessOrds globalOrdinalsValues(LeafReaderContext context) { RandomAccessOrds values = valuesSource.globalOrdinalsValues(context); return replaceMissing(values, missing); } };
public long globalMaxOrd(IndexSearcher indexSearcher) throws IOException { IndexReader indexReader = indexSearcher.getIndexReader(); if (indexReader.leaves().isEmpty()) { return 0; } else { LeafReaderContext atomicReaderContext = indexReader.leaves().get(0); SortedSetDocValues values = globalOrdinalsValues(atomicReaderContext); return values.getValueCount(); } }
@Override public RandomAccessOrds globalOrdinalsValues(LeafReaderContext context) { RandomAccessOrds values = valuesSource.globalOrdinalsValues(context); return replaceMissing(values, missing); } };
@Override public LeafBucketCollector getLeafCollector(LeafReaderContext ctx, final LeafBucketCollector sub) throws IOException { globalOrds = valuesSource.globalOrdinalsValues(ctx); if (acceptedGlobalOrdinals == null && includeExclude != null) { acceptedGlobalOrdinals = includeExclude.acceptedGlobalOrdinals(globalOrds); } if (acceptedGlobalOrdinals != null) { globalOrds = new FilteredOrdinals(globalOrds, acceptedGlobalOrdinals); } return newCollector(globalOrds, sub); }
@Override public SortedSetDocValues globalOrdinalsValues(LeafReaderContext context) throws IOException { SortedSetDocValues values = valuesSource.globalOrdinalsValues(context); return replaceMissing(values, missing); }
@Override public SortedSetDocValues globalOrdinalsValues(LeafReaderContext context) throws IOException { SortedSetDocValues values = valuesSource.globalOrdinalsValues(context); return replaceMissing(values, missing); }
public long globalMaxOrd(IndexSearcher indexSearcher) { IndexReader indexReader = indexSearcher.getIndexReader(); if (indexReader.leaves().isEmpty()) { return 0; } else { LeafReaderContext atomicReaderContext = indexReader.leaves().get(0); RandomAccessOrds values = globalOrdinalsValues(atomicReaderContext); return values.getValueCount(); } }
@Override public LongUnaryOperator globalOrdinalsMapping(LeafReaderContext context) throws IOException { return getGlobalMapping(valuesSource.ordinalsValues(context), valuesSource.globalOrdinalsValues(context), valuesSource.globalOrdinalsMapping(context), missing); } };
private SortedSetDocValues getGlobalOrds(LeafReaderContext ctx) throws IOException { return acceptedGlobalOrdinals == null ? valuesSource.globalOrdinalsValues(ctx) : new FilteredOrdinals(valuesSource.globalOrdinalsValues(ctx), acceptedGlobalOrdinals); }
@Override public LongUnaryOperator globalOrdinalsMapping(LeafReaderContext context) throws IOException { return getGlobalMapping(valuesSource.ordinalsValues(context), valuesSource.globalOrdinalsValues(context), valuesSource.globalOrdinalsMapping(context), missing); } };
@Override public SortedSetDocValues globalOrdinalsValues(LeafReaderContext context) throws IOException { SortedSetDocValues values = valuesSource.globalOrdinalsValues(context); return replaceMissing(values, missing); }