Examples of numDocs()


Examples of com.browseengine.bobo.api.BoboIndexReader.numDocs()

    BoboIndexReader boboReader = BoboIndexReader.getInstance(idxReader,_fconf);

   
    for (int i=1;i<docs.length;++i){
      Document doc = docs[i];
      int numDocs = boboReader.numDocs();
      BoboIndexReader reader = (BoboIndexReader)boboReader.reopen(true);
      assertSame(boboReader,reader);
     
      Directory tmpDir = new RAMDirectory();
      IndexWriter subWriter = new IndexWriter(tmpDir,new StandardAnalyzer(Version.LUCENE_29),MaxFieldLength.UNLIMITED);
View Full Code Here

Examples of com.browseengine.bobo.api.BoboIndexReader.numDocs()

      subWriter.close();
      writer.addIndexesNoOptimize(new Directory[]{tmpDir});
      writer.commit();
      reader = (BoboIndexReader)boboReader.reopen();
      assertNotSame(boboReader, reader);
      assertEquals(numDocs+1,reader.numDocs());
      boboReader = reader;
    }
    writer.deleteDocuments(new Term("id","1"));
    writer.commit();
    int numDocs = boboReader.numDocs();
View Full Code Here

Examples of com.browseengine.bobo.api.BoboIndexReader.numDocs()

    writer.deleteDocuments(new Term("id","1"));
    writer.commit();
    int numDocs = boboReader.numDocs();
    BoboIndexReader newReader = (BoboIndexReader)boboReader.reopen();
    assertNotSame(newReader,boboReader);
    int numDocs2 = newReader.numDocs();
    if (boboReader!=newReader){
      boboReader.close();
      boboReader = newReader;
    }
    assertEquals(numDocs-1,numDocs2);
View Full Code Here

Examples of com.browseengine.bobo.api.MultiBoboBrowser.numDocs()

    MultiBoboBrowser browser = null;
    try
    {
      browser = new MultiBoboBrowser(BoboBrowser.createBrowsables(readerList));
      res.setNumDocs(browser.numDocs());

      return res;
    }
    catch (Exception e)
    {
View Full Code Here

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

  public DistanceComparator setNextReader(final AtomicReaderContext newContext) throws IOException {
    final AtomicReader atomicReader = newContext.reader();
    final Doubles unbasedLatitudeValues = FieldCache.DEFAULT.getDoubles( atomicReader, latitudeField, false );
    final Doubles unbasedLongitudeValues = FieldCache.DEFAULT.getDoubles( atomicReader, longitudeField, false );
    this.docBase = newContext.docBase;
    final int numDocs = atomicReader.numDocs();
    for ( int i = 0; i < numDocs; i++ ) {
      //TODO avoid fully copying this structure
      latitudeValues.put( this.docBase + i, unbasedLatitudeValues.get( i ) );
      longitudeValues.put( this.docBase + i, unbasedLongitudeValues.get( i ) );
    }
View Full Code Here

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

            
            assert false : "unreferenced files: before delete:\n    " + Arrays.toString(startFiles) + "\n  after delete:\n    " + Arrays.toString(endFiles) + extras;
          }

          DirectoryReader ir1 = DirectoryReader.open(this);
          int numDocs1 = ir1.numDocs();
          ir1.close();
          new IndexWriter(this, new IndexWriterConfig(LuceneTestCase.TEST_VERSION_CURRENT, null)).close();
          DirectoryReader ir2 = DirectoryReader.open(this);
          int numDocs2 = ir2.numDocs();
          ir2.close();
View Full Code Here

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

          DirectoryReader ir1 = DirectoryReader.open(this);
          int numDocs1 = ir1.numDocs();
          ir1.close();
          new IndexWriter(this, new IndexWriterConfig(LuceneTestCase.TEST_VERSION_CURRENT, null)).close();
          DirectoryReader ir2 = DirectoryReader.open(this);
          int numDocs2 = ir2.numDocs();
          ir2.close();
          assert numDocs1 == numDocs2 : "numDocs changed after opening/closing IW: before=" + numDocs1 + " after=" + numDocs2;
        }
      }
    }
View Full Code Here

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

   * @throws Exception
   */
  public static void main(String[] args) throws Exception {
    addIndex();
    IndexReader reader = IndexReader.open(lucenePath);
    System.out.println("�ĵ���:"+reader.numDocs());
    TermEnum tes = reader.terms();
    while(tes.next()){
      Term t = tes.term();
      System.out.println(t.toString());
    }
View Full Code Here

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

  SegmentInfos infos=new SegmentInfos();
  infos.read(targetDir);
  System.out.println("result segment count: "+infos.size());
 
  IndexReader r = IndexReader.open(targetDir,true);
  System.out.println("num docs: "+r.numDocs());
  r.close();
  }
}
View Full Code Here

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

    profile.setSuggestPopularTagsEnabled(false);
    indexer = new SearchSuggestIndexer();
    indexer.setSearchIndexProfile(profile);
    indexer.init();
    IndexReader reader = indexer.openSuggestIndexReader();
    assertEquals(13, reader.numDocs());
  }

  public void testInit2() throws Exception{
    profile = new SearchIndexProfile();
    profile.setSearchIndexDirectory("target/search-data");   
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.