@Override public LongValues getValues(LeafReaderContext ctx, DoubleValues scores) throws IOException { final NumericDocValues values = DocValues.getNumeric(ctx.reader(), field); return toLongValues(values); }
/** Retrieves the NumericDocValues for the field in this segment */ protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException { return DocValues.getNumeric(context.reader(), field); } }
@Override public DoubleValues getValues(LeafReaderContext ctx, DoubleValues scores) throws IOException { final NumericDocValues values = DocValues.getNumeric(ctx.reader(), field); return new DoubleValues() { @Override public double doubleValue() throws IOException { return decoder.applyAsDouble(values.longValue()); } @Override public boolean advanceExact(int target) throws IOException { return values.advanceExact(target); } }; }
/** Wraps a {@link SortedNumericDocValues} as a single-valued view if the field is an instance of {@link SortedNumericSortField}, * returns {@link NumericDocValues} for the field otherwise. */ static NumericDocValues getOrWrapNumeric(LeafReader reader, SortField sortField) throws IOException { if (sortField instanceof SortedNumericSortField) { SortedNumericSortField sf = (SortedNumericSortField) sortField; return SortedNumericSelector.wrap(DocValues.getSortedNumeric(reader, sf.getField()), sf.getSelector(), sf.getNumericType()); } else { return DocValues.getNumeric(reader, sortField.getField()); } }
values = DocValues.getNumeric(reader, field); break;
/** Retrieves the NumericDocValues for the field in this segment */ protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException { return DocValues.getNumeric(context.reader(), field); } }
protected NumericDocValues getNumericDocValues(Map context, LeafReaderContext readerContext) throws IOException { return DocValues.getNumeric(readerContext.reader(), field); }
@Override public LongValues getValues(LeafReaderContext ctx, DoubleValues scores) throws IOException { final NumericDocValues values = DocValues.getNumeric(ctx.reader(), field); return toLongValues(values); }
protected NumericDocValues getNumericDocValues(Map context, LeafReaderContext readerContext) throws IOException { return DocValues.getNumeric(readerContext.reader(), field); }
protected NumericDocValues getNumericDocValues(Map context, LeafReaderContext readerContext) throws IOException { return DocValues.getNumeric(readerContext.reader(), field); }
protected NumericDocValues getNumericDocValues(Map context, LeafReaderContext readerContext) throws IOException { return DocValues.getNumeric(readerContext.reader(), field); }
/** Retrieves the NumericDocValues for the field in this segment */ protected NumericDocValues getNumericDocValues(LeafReaderContext context, String field) throws IOException { return DocValues.getNumeric(context.reader(), field); }
@Override public DoubleValues getValues(LeafReaderContext ctx, DoubleValues scores) throws IOException { final NumericDocValues values = DocValues.getNumeric(ctx.reader(), field); return new DoubleValues() { @Override public double doubleValue() throws IOException { return decoder.applyAsDouble(values.longValue()); } @Override public boolean advanceExact(int target) throws IOException { return values.advanceExact(target); } }; }
DistanceLeafCollector(LeafReaderContext context) throws IOException { final LeafReader atomicReader = context.reader(); this.docsWithLatitude = DocValues.getDocsWithField( atomicReader, latitudeField ); this.docsWithLongitude = DocValues.getDocsWithField( atomicReader, longitudeField ); this.latitudeValues = DocValues.getNumeric( atomicReader, latitudeField ); this.longitudeValues = DocValues.getNumeric( atomicReader, longitudeField ); this.docBase = context.docBase; }
private void lazyInit() throws IOException { if ( docsWithLatitude != null ) { return; } LeafReader atomicReader = context.reader(); this.docsWithLatitude = DocValues.getDocsWithField( atomicReader, getLatitudeField() ); this.docsWithLongitude = DocValues.getDocsWithField( atomicReader, getLongitudeField() ); this.latitudeValues = DocValues.getNumeric( atomicReader, getLatitudeField() ); this.longitudeValues = DocValues.getNumeric( atomicReader, getLongitudeField() ); }
private void lazyInit() throws IOException { if ( docsWithLatitude != null ) { return; } LeafReader atomicReader = context.reader(); this.docsWithLatitude = DocValues.getDocsWithField( atomicReader, getLatitudeField() ); this.docsWithLongitude = DocValues.getDocsWithField( atomicReader, getLongitudeField() ); this.latitudeValues = DocValues.getNumeric( atomicReader, getLatitudeField() ); this.longitudeValues = DocValues.getNumeric( atomicReader, getLongitudeField() ); }
DistanceLeafCollector(LeafReaderContext context) throws IOException { final LeafReader atomicReader = context.reader(); this.docsWithLatitude = DocValues.getDocsWithField( atomicReader, latitudeField ); this.docsWithLongitude = DocValues.getDocsWithField( atomicReader, longitudeField ); this.latitudeValues = DocValues.getNumeric( atomicReader, latitudeField ); this.longitudeValues = DocValues.getNumeric( atomicReader, longitudeField ); this.docBase = context.docBase; }
@Override public void doSetNextReader(final LeafReaderContext context) throws IOException { final LeafReader atomicReader = context.reader(); docsWithLatitude = DocValues.getDocsWithField( atomicReader, latitudeField ); docsWithLongitude = DocValues.getDocsWithField( atomicReader, longitudeField ); latitudeValues = DocValues.getNumeric( atomicReader, latitudeField ); longitudeValues = DocValues.getNumeric( atomicReader, longitudeField ); }
@Override public void doSetNextReader(final LeafReaderContext context) throws IOException { final LeafReader atomicReader = context.reader(); docsWithLatitude = DocValues.getDocsWithField( atomicReader, latitudeField ); docsWithLongitude = DocValues.getDocsWithField( atomicReader, longitudeField ); latitudeValues = DocValues.getNumeric( atomicReader, latitudeField ); longitudeValues = DocValues.getNumeric( atomicReader, longitudeField ); }
/** Wraps a {@link SortedNumericDocValues} as a single-valued view if the field is an instance of {@link SortedNumericSortField}, * returns {@link NumericDocValues} for the field otherwise. */ static NumericDocValues getOrWrapNumeric(LeafReader reader, SortField sortField) throws IOException { if (sortField instanceof SortedNumericSortField) { SortedNumericSortField sf = (SortedNumericSortField) sortField; return SortedNumericSelector.wrap(DocValues.getSortedNumeric(reader, sf.getField()), sf.getSelector(), sf.getNumericType()); } else { return DocValues.getNumeric(reader, sortField.getField()); } }