Examples of DocIdSet


Examples of org.apache.lucene.search.DocIdSet

  }


  @Override
  public DocIdSet getDocIdSet(final Map context, final IndexReader reader) throws IOException {
     return new DocIdSet() {
       @Override
      public DocIdSetIterator iterator() throws IOException {
         return valueSource.getValues(context, reader).getRangeScorer(reader, lowerVal, upperVal, includeLower, includeUpper);
       }
     };
View Full Code Here

Examples of org.apache.lucene.search.DocIdSet

        final int endIdx = eidx;
        lastEndIdx = endIdx;


        return new DocIdSet() {
          @Override
          public DocIdSetIterator iterator() throws IOException {
            return new DocIdSetIterator() {
              int idx = startIdx;
              int adjustedDoc = -1;
View Full Code Here

Examples of org.apache.lucene.search.DocIdSet

   
    public DocumentFilteredIndexReader(IndexReader reader, Filter preserveFilter, boolean negateFilter) throws IOException {
      super(reader);
     
      final OpenBitSetDISI bits = new OpenBitSetDISI(in.maxDoc());
      final DocIdSet docs = preserveFilter.getDocIdSet(in);
      if (docs != null) {
        final DocIdSetIterator it = docs.iterator();
        if (it != null) {
          bits.inPlaceOr(it);
        }
      }
      // this is somehow inverse, if we negate the filter, we delete all documents it matches!
View Full Code Here

Examples of org.apache.lucene.search.DocIdSet

    long delCount = 0;

    for (QueryAndLimit ent : queriesIter) {
      Query query = ent.query;
      int limit = ent.limit;
      final DocIdSet docs = new QueryWrapperFilter(query).getDocIdSet(reader);
      if (docs != null) {
        final DocIdSetIterator it = docs.iterator();
        if (it != null) {
          while(true)  {
            int doc = it.nextDoc();
            if (doc >= limit)
              break;
View Full Code Here

Examples of org.apache.lucene.search.DocIdSet

    };
  }

  @Override
  public DocIdSet getDocIDs() {
    return new DocIdSet() {
     
      final Iterator<MatchingDocs> mdIter = matchingDocs.iterator();
      int doc = 0;
      MatchingDocs current;
      int currentLength;
View Full Code Here

Examples of org.apache.lucene.search.DocIdSet

   */
  public final static ScoredDocIDs getComplementSet(final ScoredDocIDs docids, final IndexReader reader)
      throws IOException {
    final int maxDoc = reader.maxDoc();

    DocIdSet docIdSet = docids.getDocIDs();
    final FixedBitSet complement;
    if (docIdSet instanceof FixedBitSet) {
      // That is the most common case, if ScoredDocIdsCollector was used.
      complement = ((FixedBitSet) docIdSet).clone();
    } else {
      complement = new FixedBitSet(maxDoc);
      DocIdSetIterator iter = docIdSet.iterator();
      int doc;
      while ((doc = iter.nextDoc()) < maxDoc) {
        complement.set(doc);
      }
    }
View Full Code Here

Examples of org.apache.lucene.search.DocIdSet

    return new ScoredDocIDs() {

      @Override
      public DocIdSet getDocIDs() {
        return new DocIdSet() {

          @Override
          public boolean isCacheable() { return true; }

          @Override
View Full Code Here

Examples of org.apache.lucene.search.DocIdSet

      // NOTE: we cannot pass acceptDocs here because this
      // will (most likely, justifiably) cause the filter to
      // not return a FixedBitSet but rather a
      // BitsFilteredDocIdSet.  Instead, we filter by
      // acceptDocs when we score:
      final DocIdSet parents = parentsFilter.getDocIdSet(readerContext, null);

      if (parents == null) {
        // No matches
        return null;
      }
View Full Code Here

Examples of org.apache.lucene.search.DocIdSet

  }

  private DocIdSetIterator getDISI(Filter filter, AtomicReaderContext context)
      throws IOException {
    // we dont pass acceptDocs, we will filter at the end using an additional filter
    DocIdSet docIdSet = filter.getDocIdSet(context, null);
    if (docIdSet == null) {
      return DocIdSetIterator.empty();
    } else {
      DocIdSetIterator iter = docIdSet.iterator();
      if (iter == null) {
        return DocIdSetIterator.empty();
      } else {
        return iter;
      }
View Full Code Here

Examples of org.apache.lucene.search.DocIdSet

  }

  private static DocIdSetIterator getDISI(Filter filter, AtomicReaderContext context)
      throws IOException {
    // we dont pass acceptDocs, we will filter at the end using an additional filter
    final DocIdSet set = filter.getDocIdSet(context, null);
    return set == null ? null : set.iterator();
  }
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.