Examples of leaves()


Examples of org.apache.lucene.index.IndexReader.leaves()

      IndexSearcher indexSearcher = obtainSearcher();
      final List<TermsEnum> termsEnums = new ArrayList<TermsEnum>();

      final IndexReader reader = searcher.getIndexReader();
      if (reader.maxDoc() > 0) {
        for (final AtomicReaderContext ctx : reader.leaves()) {
          Terms terms = ctx.reader().terms(F_WORD);
          if (terms != null)
            termsEnums.add(terms.iterator(null));
        }
      }
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.leaves()

    writer.close();

    int totalCategories = 0;
    IntsRef ordinals = new IntsRef();
    CategoryListIterator cli = new DocValuesCategoryListIterator("f", encoder.createMatchingDecoder());
    for (AtomicReaderContext context : reader.leaves()) {
      assertTrue("failed to initalize iterator", cli.setNextReader(context));
      int maxDoc = context.reader().maxDoc();
      int dataIdx = context.docBase;
      for (int doc = 0; doc < maxDoc; doc++, dataIdx++) {
        Set<Integer> values = new HashSet<Integer>();
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.leaves()

    writer.close();

    int totalCategories = 0;
    IntsRef ordinals = new IntsRef();
    CategoryListIterator cli = new DocValuesCategoryListIterator("f", encoder.createMatchingDecoder());
    for (AtomicReaderContext context : reader.leaves()) {
      assertTrue("failed to initalize iterator", cli.setNextReader(context));
      int maxDoc = context.reader().maxDoc();
      int dataIdx = context.docBase;
      for (int doc = 0; doc < maxDoc; doc++, dataIdx++) {
        Set<Integer> values = new HashSet<Integer>();
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.leaves()

    }
   
    w.forceMerge(1);
    IndexReader reader = w.getReader();
    w.close();
    assertEquals(1, reader.leaves().size());
   
   
   
    AtomicReaderContext context = reader.leaves().get(0);
    TermsFilter tf = new TermsFilter(terms);
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.leaves()

    w.close();
    assertEquals(1, reader.leaves().size());
   
   
   
    AtomicReaderContext context = reader.leaves().get(0);
    TermsFilter tf = new TermsFilter(terms);

    FixedBitSet bits = (FixedBitSet) tf.getDocIdSet(context, context.reader().getLiveDocs());
    assertEquals("Must be num fields - 1 since we skip only one field", num-1, bits.cardinality())
    reader.close();
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.leaves()

      }
    }
    w.forceMerge(1);
    IndexReader reader = w.getReader();
    w.close();
    assertEquals(1, reader.leaves().size());
    AtomicReaderContext context = reader.leaves().get(0);
    TermsFilter tf = new TermsFilter(new ArrayList<Term>(terms));

    FixedBitSet bits = (FixedBitSet) tf.getDocIdSet(context, context.reader().getLiveDocs());
    assertEquals(context.reader().numDocs(), bits.cardinality())
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.leaves()

    }
    w.forceMerge(1);
    IndexReader reader = w.getReader();
    w.close();
    assertEquals(1, reader.leaves().size());
    AtomicReaderContext context = reader.leaves().get(0);
    TermsFilter tf = new TermsFilter(new ArrayList<Term>(terms));

    FixedBitSet bits = (FixedBitSet) tf.getDocIdSet(context, context.reader().getLiveDocs());
    assertEquals(context.reader().numDocs(), bits.cardinality())
    reader.close();
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.leaves()

      IndexSearcher indexSearcher = obtainSearcher();
      final List<TermsEnum> termsEnums = new ArrayList<TermsEnum>();

      final IndexReader reader = searcher.getIndexReader();
      if (reader.maxDoc() > 0) {
        for (final AtomicReaderContext ctx : reader.leaves()) {
          Terms terms = ctx.reader().terms(F_WORD);
          if (terms != null)
            termsEnums.add(terms.iterator(null));
        }
      }
View Full Code Here

Examples of org.apache.lucene.index.IndexReader.leaves()

    };
    String shard = "shard";
    TableDescriptor table = new TableDescriptor();
    table.setName("test");

    AtomicReader reader = indexReader.leaves().iterator().next().reader();

    long t1 = System.nanoTime();
    indexWarmup.warmBlurIndex(table, shard, reader, isClosed, releaseReader, pauseWarmup);
    long t2 = System.nanoTime();
    System.out.println((t2 - t1) / 1000000.0);
View Full Code Here

Examples of org.apache.lucene.index.IndexReaderContext.leaves()

    public final ShardSearcher[] subSearchers;
    public final int[] docStarts;

    public ShardState(IndexSearcher s) {
      final IndexReaderContext ctx = s.getTopReaderContext();
      final List<AtomicReaderContext> leaves = ctx.leaves();
      subSearchers = new ShardSearcher[leaves.size()];
      for(int searcherIDX=0;searcherIDX<subSearchers.length;searcherIDX++) {
        subSearchers[searcherIDX] = new ShardSearcher(leaves.get(searcherIDX), ctx);
      }
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.