Package org.apache.lucene.index

Examples of org.apache.lucene.index.AtomicReader


  private Iterable<String> getFields(IndexReader reader) throws IOException {
    Set<String> fields = new TreeSet<String>();
    for (IndexReaderContext ctext : reader.getContext().leaves()) {
      AtomicReaderContext atomicReaderContext = (AtomicReaderContext) ctext;
      AtomicReader atomicReader = atomicReaderContext.reader();
      if (atomicReader instanceof SegmentReader) {
        for (String f : atomicReader.fields()) {
          fields.add(f);
        }
      }
    }
    return fields;
View Full Code Here


      if (_isClosed.get()) {
        LOG.info("Context [{0}] index closed", context);
        return null;
      }
      AtomicReaderContext atomicReaderContext = (AtomicReaderContext) ctext;
      AtomicReader atomicReader = atomicReaderContext.reader();
      if (atomicReader instanceof SegmentReader) {
        SegmentReader segmentReader = (SegmentReader) atomicReader;
        if (segmentReader.getSegmentName().equals(segmentName)) {
          return segmentReader.directory();
        }
View Full Code Here

      if (_isClosed.get()) {
        LOG.info("Context [{0}] index closed", context);
        return null;
      }
      AtomicReaderContext atomicReaderContext = (AtomicReaderContext) ctext;
      AtomicReader atomicReader = atomicReaderContext.reader();
      results.putAll(sampleIndex(atomicReader, context));
    }
    return results;
  }
View Full Code Here

    this.fieldName = fieldName;
  }

  @Override
  public void loadNewCacheValues(AtomicReaderContext context) throws IOException {
    final AtomicReader reader = context.reader();
    currentCache = FieldCache.DEFAULT.getFloats( reader, fieldName, false );
  }
View Full Code Here

    this.fieldName = fieldName;
  }

  @Override
  public void loadNewCacheValues(AtomicReaderContext context) throws IOException {
    final AtomicReader reader = context.reader();
    currentCache = FieldCache.DEFAULT.getLongs( reader, fieldName, false );
  }
View Full Code Here

    this.fieldName = fieldName;
  }

  @Override
  public void loadNewCacheValues(AtomicReaderContext context) throws IOException {
    final AtomicReader reader = context.reader();
    currentCache = FieldCache.DEFAULT.getInts( reader, fieldName, false );
  }
View Full Code Here

    this.fieldName = fieldName;
  }

  @Override
  public void loadNewCacheValues(AtomicReaderContext context) throws IOException {
    final AtomicReader reader = context.reader();
    currentCache = FieldCache.DEFAULT.getTerms( reader, fieldName, false );
  }
View Full Code Here

    this.fieldName = fieldName;
  }

  @Override
  public void loadNewCacheValues(AtomicReaderContext context) throws IOException {
    final AtomicReader reader = context.reader();
    currentCache = FieldCache.DEFAULT.getDoubles( reader, fieldName, false );
  }
View Full Code Here

  }

  private void initFacetCounts(AtomicReaderContext context) throws IOException {
    String fieldName = facetRequest.getFieldName();
    // term are enumerated by field name and within field names by term value
    final AtomicReader atomicReader = context.reader();
    final Terms terms = atomicReader.terms( fieldName );
    if ( terms == null ) {
      //if the Reader has no fields at all,
      //undefined field or no matches
      return;
    }
View Full Code Here

      }
      subSets = FilterOptimizationHelper.mergeByBitAnds( subSets );
      if ( subSets.size() == 1 ) {
        return subSets.get( 0 );
      }
      final AtomicReader reader = context.reader();
      return new AndDocIdSet( subSets, reader.maxDoc() );
    }
  }
View Full Code Here

TOP

Related Classes of org.apache.lucene.index.AtomicReader

Copyright © 2018 www.massapicom. 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.