Package org.apache.lucene.index

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


     */
    if (logic == AND) {
      result = new OpenBitSetDISI(getDISI(chain[index[0]], context), reader.maxDoc());
      ++index[0];
    } else if (logic == ANDNOT) {
      result = new OpenBitSetDISI(getDISI(chain[index[0]], context), reader.maxDoc());
      result.flip(0, reader.maxDoc()); // NOTE: may set bits for deleted docs.
      ++index[0];
    } else {
      result = new OpenBitSetDISI(reader.maxDoc());
    }
View Full Code Here


    if (logic == AND) {
      result = new OpenBitSetDISI(getDISI(chain[index[0]], context), reader.maxDoc());
      ++index[0];
    } else if (logic == ANDNOT) {
      result = new OpenBitSetDISI(getDISI(chain[index[0]], context), reader.maxDoc());
      result.flip(0, reader.maxDoc()); // NOTE: may set bits for deleted docs.
      ++index[0];
    } else {
      result = new OpenBitSetDISI(reader.maxDoc());
    }
    return result;
View Full Code Here

    } else if (logic == ANDNOT) {
      result = new OpenBitSetDISI(getDISI(chain[index[0]], context), reader.maxDoc());
      result.flip(0, reader.maxDoc()); // NOTE: may set bits for deleted docs.
      ++index[0];
    } else {
      result = new OpenBitSetDISI(reader.maxDoc());
    }
    return result;
  }

  /**
 
View Full Code Here

      if (fc.getOccur() == Occur.SHOULD) {
        hasShouldClauses = true;
        final DocIdSetIterator disi = getDISI(fc.getFilter(), context);
        if (disi == null) continue;
        if (res == null) {
          res = new FixedBitSet(reader.maxDoc());
        }
        res.or(disi);
      }
    }
    if (hasShouldClauses && res == null)
View Full Code Here

   
    for (final FilterClause fc : clauses) {
      if (fc.getOccur() == Occur.MUST_NOT) {
        if (res == null) {
          assert !hasShouldClauses;
          res = new FixedBitSet(reader.maxDoc());
          res.set(0, reader.maxDoc()); // NOTE: may set bits on deleted docs
        }
        final DocIdSetIterator disi = getDISI(fc.getFilter(), context);
        if (disi != null) {
          res.andNot(disi);
View Full Code Here

    for (final FilterClause fc : clauses) {
      if (fc.getOccur() == Occur.MUST_NOT) {
        if (res == null) {
          assert !hasShouldClauses;
          res = new FixedBitSet(reader.maxDoc());
          res.set(0, reader.maxDoc()); // NOTE: may set bits on deleted docs
        }
        final DocIdSetIterator disi = getDISI(fc.getFilter(), context);
        if (disi != null) {
          res.andNot(disi);
        }
View Full Code Here

        final DocIdSetIterator disi = getDISI(fc.getFilter(), context);
        if (disi == null) {
          return null; // no documents can match
        }
        if (res == null) {
          res = new FixedBitSet(reader.maxDoc());
          res.or(disi);
        } else {
          res.and(disi);
        }
      }
View Full Code Here

            final AtomicReader reader = context.reader();
            DocsEnum termDocsEnum = reader.termDocsEnum(new Term("field", "0"));
            if (termDocsEnum == null) {
              return null; // no docs -- return null
            }
            final BitSet bitSet = new BitSet(reader.maxDoc());
            int d;
            while ((d = termDocsEnum.nextDoc()) != DocsEnum.NO_MORE_DOCS) {
              bitSet.set(d, true);
            }
            return new DocIdSet() {
View Full Code Here

          FacetLabel cp = new FacetLabel(FacetsConfig.stringToPath(te.term().utf8ToString()));
          final int ordinal = addCategory(cp);
          docs = te.docs(null, docs, DocsEnum.FLAG_NONE);
          ordinalMap.addMapping(docs.nextDoc() + base, ordinal);
        }
        base += ar.maxDoc(); // no deletions, so we're ok
      }
      ordinalMap.addDone();
    } finally {
      r.close();
    }
View Full Code Here

      r = SlowCompositeReaderWrapper.wrap(DirectoryReader.open(w, false));
      //long t1 = System.nanoTime();
      w.rollback();

      final int maxDoc = r.maxDoc();

      final NumericDocValues weights = r.getNumericDocValues("weight");

      final Sorter.DocComparator comparator = new Sorter.DocComparator() {
          @Override
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.