@Override public SortedNumericDocValues longValues(LeafReaderContext context) { return indexFieldData.load(context).getLongValues(); }
@Override public SortedNumericDoubleValues doubleValues(LeafReaderContext context) { return indexFieldData.load(context).getDoubleValues(); } }
@Override public SortedBinaryDocValues bytesValues(LeafReaderContext context) { return indexFieldData.load(context).getBytesValues(); }
} else if (indexFieldData instanceof IndexNumericFieldData) { if (((IndexNumericFieldData) indexFieldData).getNumericType().isFloatingPoint()) { doubleValues = ((AtomicNumericFieldData) data).getDoubleValues(); } else { longValues = ((AtomicNumericFieldData) data).getLongValues();
@Override public long ramBytesUsed() { return scaledFieldData.ramBytesUsed(); }
@Override public void close() { scaledFieldData.close(); }
} else if (indexFieldData instanceof IndexNumericFieldData) { if (((IndexNumericFieldData) indexFieldData).getNumericType().isFloatingPoint()) { doubleValues = ((AtomicNumericFieldData) data).getDoubleValues(); } else { longValues = ((AtomicNumericFieldData) data).getLongValues();
@Override public long ramBytesUsed() { return scaledFieldData.ramBytesUsed(); }
@Override public void close() { scaledFieldData.close(); }
@Override public LongValues getValues(LeafReaderContext ctx, DoubleValues scores) throws IOException { SortedNumericDocValues values = field.load(ctx).getLongValues(); return new LongValues() { long current = -1; @Override public long longValue() throws IOException { return current; } @Override public boolean advanceExact(int doc) throws IOException { boolean hasValue = values.advanceExact(doc); if (hasValue) { assert values.docValueCount() == 1; current = values.nextValue(); return true; } else { return false; } } }; }
protected SortedNumericDoubleValues getValues(LeafReaderContext context) throws IOException { return indexFieldData.load(context).getDoubleValues(); }
} else if (indexFieldData instanceof IndexNumericFieldData) { if (((IndexNumericFieldData) indexFieldData).getNumericType().isFloatingPoint()) { doubleValues = ((AtomicNumericFieldData) data).getDoubleValues(); } else { longValues = ((AtomicNumericFieldData) data).getLongValues();
@Override public long ramBytesUsed() { return scaledFieldData.ramBytesUsed(); }
@Override public SortedBinaryDocValues bytesValues(LeafReaderContext context) { return indexFieldData.load(context).getBytesValues(); }
@Override public void close() { scaledFieldData.close(); }
@Override protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException { final SortedNumericDocValues values = indexFieldData.load(context).getLongValues(); final NumericDocValues selectedValues; if (nested == null) { selectedValues = FieldData.replaceMissing(sortMode.select(values), dMissingValue); } else { final BitSet rootDocs = nested.rootDocs(context); final DocIdSetIterator innerDocs = nested.innerDocs(context); final int maxChildren = nested.getNestedSort() != null ? nested.getNestedSort().getMaxChildren() : Integer.MAX_VALUE; selectedValues = sortMode.select(values, dMissingValue, rootDocs, innerDocs, context.reader().maxDoc(), maxChildren); } return selectedValues; }
@Override protected String getDistanceString(LeafReaderContext ctx, int docId) throws IOException { StringBuilder values = new StringBuilder(mode.name()); values.append("["); final SortedNumericDoubleValues doubleValues = fieldData.load(ctx).getDoubleValues(); if (doubleValues.advanceExact(docId)) { final int num = doubleValues.docValueCount(); for (int i = 0; i < num; i++) { double value = doubleValues.nextValue(); values.append("Math.max(Math.abs("); values.append(value).append("(=doc value) - "); values.append(origin).append("(=origin))) - "); values.append(offset).append("(=offset), 0)"); if (i != num - 1) { values.append(", "); } } } else { values.append("0.0"); } values.append("]"); return values.toString(); }
if (terms == null) { data = AtomicDoubleFieldData.empty(reader.maxDoc()); estimator.afterLoad(null, data.ramBytesUsed()); return data; } finally { if (success) { estimator.afterLoad(null, data.ramBytesUsed());
@Override public SortedBinaryDocValues bytesValues(LeafReaderContext context) { return indexFieldData.load(context).getBytesValues(); }
@Override public SortedNumericDocValues longValues(LeafReaderContext context) { return indexFieldData.load(context).getLongValues(); }