Package org.apache.lucene.index

Examples of org.apache.lucene.index.AtomicReader.numDocs()


  public DistanceComparator setNextReader(final AtomicReaderContext newContext) throws IOException {
    final AtomicReader atomicReader = newContext.reader();
    final Doubles unbasedLatitudeValues = FieldCache.DEFAULT.getDoubles( atomicReader, latitudeField, false );
    final Doubles unbasedLongitudeValues = FieldCache.DEFAULT.getDoubles( atomicReader, longitudeField, false );
    this.docBase = newContext.docBase;
    final int numDocs = atomicReader.numDocs();
    for ( int i = 0; i < numDocs; i++ ) {
      //TODO avoid fully copying this structure
      latitudeValues.put( this.docBase + i, unbasedLatitudeValues.get( i ) );
      longitudeValues.put( this.docBase + i, unbasedLongitudeValues.get( i ) );
    }
View Full Code Here


  @Override
  public void setNextReader(AtomicReaderContext newContext) throws IOException {
    delegate.setNextReader( newContext );
    final AtomicReader atomicReader = newContext.reader();
    final int numDocs = atomicReader.numDocs();
    final Doubles unbasedLatitudeValues = FieldCache.DEFAULT.getDoubles( atomicReader, latitudeField, false );
    final Doubles unbasedLongitudeValues = FieldCache.DEFAULT.getDoubles( atomicReader, longitudeField, false );

    this.docBase = newContext.docBase;
    for ( int i = 0 ; i < numDocs; i ++ ) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.