@Override public BytesRef get(int index) { return values.valueAt(index); }
@Override public BytesRef next() { return values.valueAt(this.count++); }
@Override public BytesRef valueAt(int index) { if (count > 0) { return values.valueAt(index); } else if (index == 0) { return missing; } else { throw new IndexOutOfBoundsException(); } }
@Override public BytesRef valueAt(int index) { if (count > 0) { return values.valueAt(index); } else if (index == 0) { return missing; } else { throw new IndexOutOfBoundsException(); } }
public BytesRef getBytesValue() { if (values.count() > 0) { return values.valueAt(0); } else { return null; } }
@Override public long next() { final BytesRef term = values.valueAt(this.count++); return LongBloomFilter.hash3_x64_128(term.bytes, term.offset, term.length, 0); }
@Override public long valueAt(int index) { final BytesRef bytes = values.valueAt(index); org.elasticsearch.common.hash.MurmurHash3.hash128(bytes.bytes, bytes.offset, bytes.length, 0, hash); return hash.h1; } }
@Override public String get(int index) { return values.valueAt(index).utf8ToString(); }
public BytesRef getValue() { int numValues = values.count(); if (numValues == 0) { return new BytesRef(); } return values.valueAt(0); }
@Override public double score(int docId, float subQueryScore) { uidByteData.setDocument(docId); int hash = StringHelper.murmurhash3_x86_32(uidByteData.valueAt(0), saltedSeed); return (hash & 0x00FFFFFF) / (float)(1 << 24); // only use the lower 24 bits to construct a float from 0.0-1.0 }
@Override protected BytesRef pick(SortedBinaryDocValues values, BytesRef missingValue, int doc) { values.setDocument(doc); final int count = values.count(); return count > 0 ? values.valueAt(count - 1) : missingValue; }
@Override protected BytesRef pick(SortedBinaryDocValues values, BytesRef missingValue, int doc) { values.setDocument(doc); final int count = values.count(); return count > 0 ? values.valueAt(0) : missingValue; }
@Override protected BytesRef pick(SortedBinaryDocValues values, BytesRef missingValue, int doc) { values.setDocument(doc); final int count = values.count(); return count > 0 ? values.valueAt(count - 1) : missingValue; }
@Override public double score(int docId, float subQueryScore) { uidByteData.setDocument(docId); int hash = StringHelper.murmurhash3_x86_32(uidByteData.valueAt(0), saltedSeed); return (hash & 0x00FFFFFF) / (float)(1 << 24); // only use the lower 24 bits to construct a float from 0.0-1.0 }
@Override protected BytesRef pick(SortedBinaryDocValues values, BytesRef missingValue, int doc) { values.setDocument(doc); final int count = values.count(); return count > 0 ? values.valueAt(0) : missingValue; }
protected final Query getQuery(int doc) { values.setDocument(doc); final int numValues = values.count(); if (numValues == 0) { return null; } assert numValues == 1; current = Uid.splitUidIntoTypeAndId(values.valueAt(0))[1]; return queries.get(current); }
@Override public void collect(int doc, long bucket) throws IOException { values.setDocument(doc); final int valuesCount = values.count(); for (int i = 0, lo = 0; i < valuesCount; ++i) { final BytesRef value = values.valueAt(i); lo = collect(doc, value, bucket, lo); } }
@Override protected boolean matchDoc(int doc) { values.setDocument(doc); final int numVals = values.count(); for (int i = 0; i < numVals; i++) { final BytesRef term = values.valueAt(i); long termHash = LongBloomFilter.hash3_x64_128(term.bytes, term.offset, term.length, 0); if (termsSet.contains(termHash)) { return true; } } return false; } };
@Override public void setDocument(int docId) { bytesValues.setDocument(docId); count = bytesValues.count(); grow(); for (int i = 0; i < count; ++i) { final BytesRef value = bytesValues.valueAt(i); script.setNextAggregationValue(value.utf8ToString()); values[i].copyChars(script.run().toString()); } sort(); }
@Override public void setDocument(int docId) { bytesValues.setDocument(docId); count = bytesValues.count(); grow(); for (int i = 0; i < count; ++i) { final BytesRef value = bytesValues.valueAt(i); script.setNextVar("_value", value.utf8ToString()); values[i].copyChars(script.run().toString()); } sort(); }