public boolean nextPosition() {
   if (++position >= values.ordinals().getNumOrds()) {
     return false;
   }
   current = values.getValueByOrd(position);
   return true;
 }
 @Override
 public void setNextReader(AtomicReaderContext reader) {
   globalValues = valuesSource.globalBytesValues();
   globalOrdinals = globalValues.ordinals();
   if (acceptedGlobalOrdinals != null) {
     globalOrdinals = new FilteredOrdinals(globalOrdinals, acceptedGlobalOrdinals);
   } else if (includeExclude != null) {
     acceptedGlobalOrdinals = includeExclude.acceptedGlobalOrdinals(globalOrdinals, valuesSource);
     globalOrdinals = new FilteredOrdinals(globalOrdinals, acceptedGlobalOrdinals);
   }
 }
예제 #3
0
 @Override
 public void setNextReader(AtomicReaderContext context) throws IOException {
   values = indexFieldData.load(context).getBytesValues(parentType);
   if (values != null) {
     ordinals = values.ordinals();
     final long maxOrd = ordinals.getMaxOrd();
     if (parentIdsIndex == null) {
       parentIdsIndex = bigArrays.newLongArray(BigArrays.overSize(maxOrd), false);
     } else if (parentIdsIndex.size() < maxOrd) {
       parentIdsIndex = bigArrays.grow(parentIdsIndex, maxOrd);
     }
     parentIdsIndex.fill(0, maxOrd, -1L);
   }
 }
    @Override
    public void setNextReader(AtomicReaderContext reader) {
      if (segmentOrdinals != null && segmentOrdinals.getMaxOrd() != globalOrdinals.getMaxOrd()) {
        mapSegmentCountsToGlobalCounts();
      }

      globalValues = valuesSource.globalBytesValues();
      globalOrdinals = globalValues.ordinals();

      BytesValues.WithOrdinals bytesValues = valuesSource.bytesValues();
      segmentOrdinals = bytesValues.ordinals();
      if (segmentOrdinals.getMaxOrd() != globalOrdinals.getMaxOrd()) {
        current = segmentDocCounts;
      } else {
        current = getDocCounts();
      }
    }
 public ReaderAggregator(BytesValues.WithOrdinals values) {
   this.values = values;
   this.counts = CacheRecycler.popIntArray(values.ordinals().getNumOrds());
 }
 @Override
 protected void doCollect(int doc) throws IOException {
   values.ordinals().forEachOrdinalInDoc(doc, current);
 }