@Override public boolean advanceExact(int doc) throws IOException { return values.advanceExact(doc); } };
@Override public boolean advanceExact(int docId) throws IOException { return values.advanceExact(docId); }
@Override public boolean advanceExact(int doc) throws IOException { return idValues.advanceExact(doc); }
@Override public boolean advanceExact(int target) throws IOException { if (values.advanceExact(target)) { value = pick(values); return true; } else { value = missingValue; return missingValue != null; } }
@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 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 double score(int docId, float subQueryScore) throws IOException { int hash; if (values == null) { hash = BitMixer.mix(ctx.docBase + docId, saltedSeed); } else if (values.advanceExact(docId)) { hash = StringHelper.murmurhash3_x86_32(values.nextValue(), saltedSeed); } else { // field has no value hash = saltedSeed; } return (hash & 0x00FFFFFF) / (float)(1 << 24); // only use the lower 24 bits to construct a float from 0.0-1.0 }
@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; } } }
values.addAll(scriptValues); } 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; }
if (values.advanceExact(docId)) { final int valueCount = values.docValueCount(); for (int i = 0; i < valueCount; ++i) {
@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 { 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); } } }