Package org.apache.lucene.search

Examples of org.apache.lucene.search.DocIdSetIterator.docID()


          doc = ds1.nextSetBit(doc + 1);
          if (doc == -1) {
            doc = DocIdSetIterator.NO_MORE_DOCS;
          }
          assertEquals(doc, it2.nextDoc());
          assertEquals(doc, it2.docID());
        } else {
          final int target = doc + 1 + random().nextInt(random().nextBoolean() ? 64 : Math.max(numBits / 8, 1));
          doc = ds1.nextSetBit(target);
          if (doc == -1) {
            doc = DocIdSetIterator.NO_MORE_DOCS;
View Full Code Here


          doc = ds1.nextSetBit(target);
          if (doc == -1) {
            doc = DocIdSetIterator.NO_MORE_DOCS;
          }
          assertEquals(doc, it2.advance(target));
          assertEquals(doc, it2.docID());
        }
      }
    }

    // bits()
View Full Code Here

      }
    }
    DocIdSetIterator m = vintList.iterator();
    for (int i = 0; i < ints.length; i++) {
      assertTrue("No end of Matcher at: " + i, m.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
      assertEquals(ints[i], m.docID());
    }
    assertTrue("End of Matcher", m.nextDoc() == DocIdSetIterator.NO_MORE_DOCS);
  }

  void tstVIntList(
View Full Code Here

      // which is cacheable.
      if (it == null) {
        return DocIdSet.EMPTY_DOCIDSET;
      } else {
        while (it.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
          docIds.add(it.docID());
        }
        return new IntListDocIdSet(docIds);
      }
    }
  }
View Full Code Here

  public static List<Integer> asList(final FixedBitSet bitSet) {
    DocIdSetIterator it = bitSet.iterator();
    List<Integer> ints = Lists.newArrayList();
    try {
      while (it.nextDoc() != DocIdSetIterator.NO_MORE_DOCS) {
        ints.add(it.docID());
      }
    } catch (IOException e) {
      throw new RuntimeException(
          "Impossible IOException when iterating in memory");
    }
View Full Code Here

      }
    }
    DocIdSetIterator m = vintList.iterator();
    for (int i = 0; i < ints.length; i++) {
      assertTrue("No end of Matcher at: " + i, m.nextDoc() != DocIdSetIterator.NO_MORE_DOCS);
      assertEquals(ints[i], m.docID());
    }
    assertTrue("End of Matcher", m.nextDoc() == DocIdSetIterator.NO_MORE_DOCS);
  }

  void tstVIntList(
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.