Examples of numDocs()


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

    Benchmark benchmark = execBenchmark(algLines);

    // 3. test number of docs in the index
    IndexReader ir = DirectoryReader.open(benchmark.getRunData().getDirectory());
    int ndocsExpected = 2 * 20; // first 20 reuters docs.
    assertEquals("wrong number of docs in the index!", ndocsExpected, ir.numDocs());
    ir.close();
  }


  /**
 
View Full Code Here

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

    Benchmark benchmark = execBenchmark(algLines);

    // 3. test number of docs in the index
    IndexReader ir = DirectoryReader.open(benchmark.getRunData().getDirectory());
    int ndocsExpected = 20// first 20 reuters docs.
    assertEquals("wrong number of docs in the index!", ndocsExpected, ir.numDocs());
    ir.close();
  }
 
  /**
   * Test that we can close IndexWriter with argument "false".
View Full Code Here

Examples of org.apache.lucene.index.IndexWriter.numDocs()

        Assert.assertTrue("writer has no deletions", w.hasDeletions());

      Assert.assertEquals("writer is missing some deleted docs",
                          numDeletedDocs, w.maxDoc());
      Assert.assertEquals("writer has non-deleted docs",
                          0, w.numDocs());
      w.close();
      IndexReader r = IndexReader.open(d, true);
      Assert.assertEquals("reader has wrong number of deleted docs",
                          numDeletedDocs, r.numDeletedDocs());
      r.close();
View Full Code Here

Examples of org.apache.lucene.index.MultiReader.numDocs()

      long start=System.currentTimeMillis();
      TopDocs docs=searcher.search(q, null, 10);
      long end=System.currentTimeMillis();
     
      result.setTime(end-start);
      result.setTotalDocs(multiReader.numDocs());
      result.setTotalHits(docs.totalHits);
     

      ScoreDoc[] scoreDocs=docs.scoreDocs;
      ArrayList<SearchHit> hitList=new ArrayList<SearchHit>(scoreDocs.length);
View Full Code Here

Examples of org.apache.lucene.index.SegmentReader.numDocs()

      if (subReader instanceof SegmentReader){
        SegmentReader sr = (SegmentReader)subReader;
        String segmentName = sr.getSegmentName();
        ZoieSegmentReader<R> zoieSegmentReader = _readerMap.get(segmentName);
        if (zoieSegmentReader!=null){
          int numDocs = sr.numDocs();
          int maxDocs = sr.maxDoc();
          boolean hasDeletes = false;
          if (zoieSegmentReader.numDocs() != numDocs || zoieSegmentReader.maxDoc() != maxDocs){
            hasDeletes = true;
          }
View Full Code Here

Examples of org.apache.solr.search.SolrIndexReader.numDocs()

    assertU(adoc("id","4"));
    assertU(commit());

    SolrQueryRequest sr = req("q","foo");
    SolrIndexReader r = sr.getSearcher().getReader();
    assertTrue(r.maxDoc() > r.numDocs());   // should have deletions
    assertTrue(r.getLeafReaders().length > 1)// more than 1 segment
    sr.close();

    assertU(commit("expungeDeletes","true"));
View Full Code Here

Examples of org.owasp.dependencycheck.data.cpe.CpeMemoryIndex.numDocs()

        } catch (DatabaseException ex) {
            throw new NoDataException(ex.getMessage(), ex);
        } finally {
            cve.close();
        }
        if (cpe.numDocs() <= 0) {
            cpe.close();
            throw new NoDataException("No documents exist");
        }
    }
}
View Full Code Here

Examples of org.springmodules.lucene.index.factory.LuceneIndexReader.numDocs()

    LuceneIndexReader indexReader = (LuceneIndexReader)indexReaderControl.getMock();

    indexFactory.getIndexReader();
    indexFactoryControl.setReturnValue(indexReader, 1);
   
    indexReader.numDocs();
    indexReaderControl.setReturnValue(3, 1);
   
    indexReader.close();
    indexReaderControl.setVoidCallable(1);
   
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.