Examples of DocIdSet


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

      // 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

          dims[dim].sidewaysCollector = drillSidewaysCollectors[dim];
          if (drillDowns[dim] instanceof Filter) {
            // Pass null for acceptDocs because we already
            // passed it to baseScorer and baseScorer is
            // MUST'd here
            DocIdSet dis = ((Filter) drillDowns[dim]).getDocIdSet(context, null);

            if (dis == null) {
              continue;
            }

            Bits bits = dis.bits();

            if (bits != null) {
              // TODO: this logic is too naive: the
              // existence of bits() in DIS today means
              // either "I'm a cheap FixedBitSet so apply me down
              // low as you decode the postings" or "I'm so
              // horribly expensive so apply me after all
              // other Query/Filter clauses pass"

              // Filter supports random access; use that to
              // prevent .advance() on costly filters:
              dims[dim].bits = bits;

              // TODO: Filter needs to express its expected
              // cost somehow, before pulling the iterator;
              // we should use that here to set the order to
              // check the filters:

            } else {
              DocIdSetIterator disi = dis.iterator();
              if (disi == null) {
                nullCount++;
                continue;
              }
              dims[dim].disi = disi;
View Full Code Here

Examples of org.apache.lucene.search.DocIdSet

            return getDocIdSet(reader, DEFAULT, index);
    }

    private DocIdSetIterator getDISI(Filter filter, IndexReader reader)
    throws IOException {
        DocIdSet docIdSet = filter.getDocIdSet(reader);
        if (docIdSet == null) {
          return DocIdSet.EMPTY_DOCIDSET.iterator();
        } else {
          DocIdSetIterator iter = docIdSet.iterator();
          if (iter == null) {
            return DocIdSet.EMPTY_DOCIDSET.iterator();
          } else {
            return iter;
          }
View Full Code Here

Examples of org.apache.lucene.search.DocIdSet

    //TODO if all andedDocIdSets are actually DocIdBitSet, use their internal BitSet instead of next algo.
    //TODO if some andedDocIdSets are DocIdBitSet, merge them first.
    int size = andedDocIdSets.size();
    DocIdSetIterator[] iterators = new DocIdSetIterator[size];
    for ( int i = 0; i < size; i++ ) {
      DocIdSet docIdSet = andedDocIdSets.get( i );
      if ( docIdSet == null ) {
        // Since Lucene 4 even the docIdSet could be returned at null to signify an empty match
        return EMPTY_DOCIDSET;
      }
      // build all iterators
      DocIdSetIterator docIdSetIterator = docIdSet.iterator();
      if ( docIdSetIterator == null ) {
        // the Lucene API permits to return null on any iterator for empty matches
        return EMPTY_DOCIDSET;
      }
      iterators[i] = docIdSetIterator;
View Full Code Here

Examples of org.apache.lucene.search.DocIdSet

        final int base = offset;
        final int maxDoc = reader.maxDoc();
        final int max = base + maxDoc;   // one past the max doc in this segment.

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

Examples of org.apache.lucene.search.DocIdSet

    this.includeUpper = upperVal != null && includeUpper;
  }

  @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

    Filter fa = a.getTopFilter();
    Filter fb = b.getTopFilter();

    // test top-level
    DocIdSet da = fa.getDocIdSet(reader);
    DocIdSet db = fb.getDocIdSet(reader);
    doTestIteratorEqual(da, db);

    // first test in-sequence sub readers
    for (SolrIndexReader sir : reader.getLeafReaders()) {
      da = fa.getDocIdSet(sir);
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 OpenBitSet complement;
    if (docIdSet instanceof OpenBitSet) {
      // That is the most common case, if ScoredDocIdsCollector was used.
      complement = (OpenBitSet) ((OpenBitSet) docIdSet).clone();
    } else {
      complement = new OpenBitSetDISI(docIdSet.iterator(), maxDoc);
    }

    complement.flip(0, maxDoc);

    // Remove all Deletions from the complement set
View Full Code Here

Examples of org.apache.lucene.search.DocIdSet

    final int size = n;

    return new ScoredDocIDs() {

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

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

          @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.