@Override public long getValue( String field ) { NumericDocValues fieldValues = readerCache.computeIfAbsent( field, this::getDocValues ); return fieldValues.get( currentDocID ); }
@Override public long getValue( String field ) { if ( ensureValidDisi() ) { if ( docValuesCache.containsKey( field ) ) { return docValuesCache.get( field ).get( currentIdIterator.docID() ); } NumericDocValues docValues = currentDocs.readDocValues( field ); docValuesCache.put( field, docValues ); return docValues.get( currentIdIterator.docID() ); } else { // same as DocValues.emptyNumeric()#get // which means, getValue carries over the semantics of NDV // -1 would also be a possibility here. return 0; } }
private void loadNextValue( LeafReaderContext context, int docID ) { NumericDocValues docValues; if ( docValuesCache.containsKey( context ) ) { docValues = docValuesCache.get( context ); } else { try { docValues = context.reader().getNumericDocValues( field ); docValuesCache.put( context, docValues ); } catch ( IOException e ) { throw new RuntimeException( e ); } } if ( docValues != null ) { currentValue = docValues.get( docID ); } else { currentValue = -1; } } }
boolean fetchNextEntityId() { try { if ( ensureValidDisi() ) { int nextDoc = currentIdIterator.nextDoc(); if ( nextDoc != DocIdSetIterator.NO_MORE_DOCS ) { index++; next = currentDocValues.get( nextDoc ); return true; } else { currentIdIterator = null; return fetchNextEntityId(); } } } catch ( IOException e ) { throw new RuntimeException( e ); } return false; } }
@Override public long getValue( String field ) { if ( ensureValidDisi() ) { if ( docValuesCache.containsKey( field ) ) { return docValuesCache.get( field ).get( currentIdIterator.docID() ); } NumericDocValues docValues = currentDocs.readDocValues( field ); docValuesCache.put( field, docValues ); return docValues.get( currentIdIterator.docID() ); } else { // same as DocValues.emptyNumeric()#get // which means, getValue carries over the semantics of NDV // -1 would also be a possibility here. return 0; } }
private void loadNextValue( LeafReaderContext context, int docID ) { NumericDocValues docValues; if ( docValuesCache.containsKey( context ) ) { docValues = docValuesCache.get( context ); } else { try { docValues = context.reader().getNumericDocValues( field ); docValuesCache.put( context, docValues ); } catch ( IOException e ) { throw new RuntimeException( e ); } } if ( docValues != null ) { currentValue = docValues.get( docID ); } else { currentValue = -1; } } }
@Override protected boolean fetchNext() { try { if ( ensureValidDisi() && remaining() > 0 ) { int nextDoc = currentIdIterator.nextDoc(); if ( nextDoc != DocIdSetIterator.NO_MORE_DOCS ) { index++; return next( currentDocValues.get( nextDoc ) ); } else { currentIdIterator = null; return fetchNext(); } } } catch ( IOException e ) { throw new RuntimeException( e ); } return false; }
@Override final public void collect(final int doc) { count++; final int value = (int) docValues.get(doc); if (value < result) result = value; } }
@Override public long get(int docID) { int subIndex = ReaderUtil.subIndex(docID, starts); return values[subIndex].get(docID - starts[subIndex]); } };
@Override public long get(int docID) { int subIndex = ReaderUtil.subIndex(docID, starts); return values[subIndex].get(docID - starts[subIndex]); } };
@Override public void copy(int slot, int doc) { double v2 = Double.longBitsToDouble(currentReaderValues.get(doc)); // Test for v2 == 0 to save Bits.get method call for // the common case (doc has value and value is non-zero): if (docsWithField != null && v2 == 0 && !docsWithField.get(doc)) { v2 = missingValue; } values[slot] = v2; }
@Override public int compareBottom(int doc) { // TODO: there are sneaky non-branch ways to compute // -1/+1/0 sign long v2 = currentReaderValues.get(doc); // Test for v2 == 0 to save Bits.get method call for // the common case (doc has value and value is non-zero): if (docsWithField != null && v2 == 0 && !docsWithField.get(doc)) { v2 = missingValue; } return Long.compare(bottom, v2); }
@Override public void copy(int slot, int doc) { long v2 = currentReaderValues.get(doc); // Test for v2 == 0 to save Bits.get method call for // the common case (doc has value and value is non-zero): if (docsWithField != null && v2 == 0 && !docsWithField.get(doc)) { v2 = missingValue; } values[slot] = v2; }
@Override public double get(int docID) { return NumericUtils.sortableIntToFloat((int) in.get(docID)); } }
@Override final public void collect(final int doc) { count++; final double value = NumericUtils.sortableLongToDouble(docValues.get(doc)); if (value > result) result = value; } }
@Override final public void collect(final int doc) { count++; final double value = NumericUtils.sortableLongToDouble(docValues.get(doc)); if (value < result) result = value; } }
@Override public long get(int docID) { return NumericUtils.sortableFloatBits((int) view.get(docID)); } };
@Override public int compareTop(int doc) { float docValue = Float.intBitsToFloat((int)currentReaderValues.get(doc)); // Test for docValue == 0 to save Bits.get method call for // the common case (doc has value and value is non-zero): if (docsWithField != null && docValue == 0 && !docsWithField.get(doc)) { docValue = missingValue; } return Float.compare(topValue, docValue); } }