@Override public boolean advanceExact(int target) throws IOException { if (values.advanceExact(target)) { value = values.doubleValue(); } else { value = missing; } return true; }
@Override public long longValue() throws IOException { return (long) values.doubleValue(); }
@Override public boolean advanceExact(int target) throws IOException { docID = target; return NumericDoubleValues.this.advanceExact(target); } @Override
@Override protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException { final SortedNumericDoubleValues values = indexFieldData.load(context).getDoubleValues(); final NumericDoubleValues 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.getRawFloatValues(); } };
@Override protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException { final SortedNumericDoubleValues values = getValues(context); final NumericDoubleValues 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.getRawDoubleValues(); } @Override
@Override public long get(int docID) { return (long) values.get(docID); }
@Override public double nextValue() throws IOException { return in.doubleValue(); }
@Override public boolean advanceExact(int target) throws IOException { docID = target; return NumericDoubleValues.this.advanceExact(target); } @Override
@Override protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException { final SortedNumericDoubleValues values = indexFieldData.load(context).getDoubleValues(); final NumericDoubleValues selectedValues; if (nested == null) { selectedValues = sortMode.select(values, dMissingValue); } else { final BitSet rootDocs = nested.rootDocs(context); final DocIdSetIterator innerDocs = nested.innerDocs(context); selectedValues = sortMode.select(values, dMissingValue, rootDocs, innerDocs, context.reader().maxDoc()); } return selectedValues.getRawFloatValues(); } };
@Override protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException { final SortedNumericDoubleValues values = getValues(context); final NumericDoubleValues selectedValues; if (nested == null) { selectedValues = sortMode.select(values, dMissingValue); } else { final BitSet rootDocs = nested.rootDocs(context); final DocIdSetIterator innerDocs = nested.innerDocs(context); selectedValues = sortMode.select(values, dMissingValue, rootDocs, innerDocs, context.reader().maxDoc()); } return selectedValues.getRawDoubleValues(); } @Override
@Override public long get(int docID) { return (long) values.get(docID); }
@Override public double score(int docId, float subQueryScore) throws IOException { if (distance.advanceExact(docId)) { return func.evaluate(distance.doubleValue(), scale); } else { return 0; } }
@Override public long longValue() throws IOException { return Float.floatToRawIntBits((float)NumericDoubleValues.this.doubleValue()); } @Override
@Override public boolean advanceExact(int target) throws IOException { docID = target; return values.advanceExact(target); }
@Override protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException { final SortedNumericDoubleValues values = indexFieldData.load(context).getDoubleValues(); final NumericDoubleValues selectedValues; if (nested == null) { selectedValues = sortMode.select(values, dMissingValue); } else { final BitSet rootDocs = nested.rootDocs(context); final DocIdSetIterator innerDocs = nested.innerDocs(context); selectedValues = sortMode.select(values, dMissingValue, rootDocs, innerDocs, context.reader().maxDoc()); } return selectedValues.getRawFloatValues(); } };
@Override protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException { final SortedNumericDoubleValues values = getValues(context); final NumericDoubleValues selectedValues; if (nested == null) { selectedValues = sortMode.select(values, dMissingValue); } else { final BitSet rootDocs = nested.rootDocs(context); final DocIdSetIterator innerDocs = nested.innerDocs(context); selectedValues = sortMode.select(values, dMissingValue, rootDocs, innerDocs, context.reader().maxDoc()); } return selectedValues.getRawDoubleValues(); } @Override
@Override public long get(int docID) { return Double.doubleToRawLongBits(NumericDoubleValues.this.get(docID)); } };
@Override public void collect(int doc, long bucket) throws IOException { if (bucket >= mins.size()) { long from = mins.size(); mins = bigArrays.grow(mins, bucket + 1); mins.fill(from, mins.size(), Double.POSITIVE_INFINITY); } if (values.advanceExact(doc)) { final double value = values.doubleValue(); double min = mins.get(bucket); min = Math.min(min, value); mins.set(bucket, min); } }
@Override public long longValue() throws IOException { return Double.doubleToRawLongBits(NumericDoubleValues.this.doubleValue()); } @Override
@Override public boolean advanceExact(int target) throws IOException { docID = target; return values.advanceExact(target); }