@Override public int count() { return values.docValueCount(); }
@Override public int docValueCount() { return idValues.docValueCount(); }
@Override public boolean advanceExact(int doc) throws IOException { if (values.advanceExact(doc)) { count = values.docValueCount(); } else { count = 0; } // always return true because we want to return a value even if // the document does not have a value return true; }
@Override public boolean advanceExact(int target) throws IOException { docID = target; if (values.advanceExact(target)) { if (values.docValueCount() > 1) { throw new IllegalArgumentException( "Sample diversifying key must be a single valued-field"); } return true; } else { return false; } }
@Override public boolean advanceExact(int target) throws IOException { docID = target; if (values.advanceExact(target)) { if (values.docValueCount() > 1) { throw new IllegalArgumentException( "Sample diversifying key must be a single valued-field"); } return true; } else { return false; } }
@Override protected BytesRef pick(SortedBinaryDocValues values) throws IOException { int count = values.docValueCount(); for (int i = 0; i < count - 1; ++i) { values.nextValue(); } return values.nextValue(); }
@Override public void collect(int doc, long bucket) throws IOException { counts = bigArrays.grow(counts, bucket + 1); if (values.advanceExact(doc)) { counts.increment(bucket, values.docValueCount()); } }
@Override public void collect(int doc, long bucket) throws IOException { if (values.advanceExact(doc)) { final int valuesCount = values.docValueCount(); for (int i = 0, lo = 0; i < valuesCount; ++i) { final BytesRef value = values.nextValue(); lo = collect(doc, value, bucket, lo); } } }
@Override public void collect(int doc, long bucket) throws IOException { if (dvs.advanceExact(doc)) { int num = dvs.docValueCount(); for (int i = 0; i < num; i++) { currentValue = dvs.nextValue(); next.collect(doc, bucket); } } else if (missingBucket) { currentValue = null; next.collect(doc, bucket); } } };
@Override public void setNextDocId(int docId) throws IOException { if (in.advanceExact(docId)) { resize(in.docValueCount()); for (int i = 0; i < count; i++) { // We need to make a copy here, because BytesBinaryDVAtomicFieldData's SortedBinaryDocValues // implementation reuses the returned BytesRef. Otherwise we would end up with the same BytesRef // instance for all slots in the values array. values[i].copyBytes(in.nextValue()); } } else { resize(0); } }
@Override public boolean advanceExact(int doc) throws IOException { if (bytesValues.advanceExact(doc)) { count = bytesValues.docValueCount(); grow(); for (int i = 0; i < count; ++i) { final BytesRef value = bytesValues.nextValue(); script.setNextAggregationValue(value.utf8ToString()); Object run = script.run(); CollectionUtils.ensureNoSelfReferences(run); values[i].copyChars(run.toString()); } sort(); return true; } else { count = 0; grow(); return false; } } }
} else if (binaryValues != null) { if (binaryValues.advanceExact(subDocId)) { for (int i = 0, count = binaryValues.docValueCount(); i < count; ++i) { values.add(format.format(binaryValues.nextValue()));
@Override public void collect(int doc, long bucket) throws IOException { assert bucket == 0; if (values.advanceExact(doc)) { final int valuesCount = values.docValueCount(); // SortedBinaryDocValues don't guarantee uniqueness so we // need to take care of dups previous.clear(); for (int i = 0; i < valuesCount; ++i) { final BytesRef bytes = values.nextValue(); if (includeExclude != null && !includeExclude.accept(bytes)) { continue; } if (i > 0 && previous.get().equals(bytes)) { continue; } long bucketOrdinal = bucketOrds.add(bytes); if (bucketOrdinal < 0) { // already seen bucketOrdinal = -1 - bucketOrdinal; collectExistingBucket(sub, doc, bucketOrdinal); } else { collectBucket(sub, doc, bucketOrdinal); } previous.copyBytes(bytes); } } } };
@Override public boolean advanceExact(int doc) throws IOException { if (values.advanceExact(doc)) { count = values.docValueCount(); } else { count = 0; } // always return true because we want to return a value even if // the document does not have a value return true; }
@Override protected BytesRef pick(SortedBinaryDocValues values) throws IOException { int count = values.docValueCount(); for (int i = 0; i < count - 1; ++i) { values.nextValue(); } return values.nextValue(); }
final int valueCount = values.docValueCount(); for (int i = 0; i < valueCount; ++i) { final BytesRef term = values.nextValue();
@Override public void collect(int doc, long bucket) throws IOException { counts = bigArrays.grow(counts, bucket + 1); if (values.advanceExact(doc)) { counts.increment(bucket, values.docValueCount()); } }
@Override public void collect(int doc, long bucket) throws IOException { counts = bigArrays.grow(counts, bucket + 1); if (values.advanceExact(doc)) { counts.increment(bucket, values.docValueCount()); } }
@Override public void collect(int doc, long bucket) throws IOException { if (values.advanceExact(doc)) { final int valuesCount = values.docValueCount(); for (int i = 0, lo = 0; i < valuesCount; ++i) { final BytesRef value = values.nextValue(); lo = collect(doc, value, bucket, lo); } } }
@Override public void collect(int doc, long bucket) throws IOException { if (values.advanceExact(doc)) { final int valuesCount = values.docValueCount(); for (int i = 0, lo = 0; i < valuesCount; ++i) { final BytesRef value = values.nextValue(); lo = collect(doc, value, bucket, lo); } } }