Examples of maxDoc()


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

      writer=new FileWriter(outFile);
      BufferedWriter bwriter=new BufferedWriter(writer);
      dumper=new IndexDumper(idxDir);
      Set<String> fields=idxReader.getFacetNames();
     
      for (int k=0;k<idxReader.maxDoc();++k){
        for (String field : fields){
          FacetHandler facetHandler = idxReader.getFacetHandler(field);
          if (facetHandler!=null){
            String[] f=facetHandler.getFieldValues(idxReader,k);
            StringBuilder buffer=new StringBuilder();
View Full Code Here

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

          CategoryPath cp = new CategoryPath(value, delimiter);
          final int ordinal = addCategory(cp);
          docs = te.docs(null, docs, DocsEnum.FLAG_NONE);
          ordinalMap.addMapping(docs.nextDoc() + base, ordinal);
        }
        base += ar.maxDoc(); // no deletions, so we're ok
      }
      ordinalMap.addDone();
    } finally {
      r.close();
    }
View Full Code Here

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

      if (segValues == null) {
        return;
      }

      final int[] counts = facetArrays.getIntArray();
      final int maxDoc = reader.maxDoc();
      assert maxDoc == matchingDocs.bits.length();

      if (dv instanceof MultiSortedSetDocValues) {
        MultiDocValues.OrdinalMap ordinalMap = ((MultiSortedSetDocValues) dv).mapping;
        int segOrd = matchingDocs.context.ord;
View Full Code Here

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

      }
      for (TermAndFreq termAndFreq : highTerms) {
        cq.add(new Term(field, termAndFreq.term));
      }
     
      TopDocs cqSearch = searcher.search(cq, reader.maxDoc());
     
      TopDocs verifySearch = searcher.search(verifyQuery, reader.maxDoc());
      assertEquals(verifySearch.totalHits, cqSearch.totalHits);
      Set<Integer> hits = new HashSet<Integer>();
      for (ScoreDoc doc : verifySearch.scoreDocs) {
View Full Code Here

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

        cq.add(new Term(field, termAndFreq.term));
      }
     
      TopDocs cqSearch = searcher.search(cq, reader.maxDoc());
     
      TopDocs verifySearch = searcher.search(verifyQuery, reader.maxDoc());
      assertEquals(verifySearch.totalHits, cqSearch.totalHits);
      Set<Integer> hits = new HashSet<Integer>();
      for (ScoreDoc doc : verifySearch.scoreDocs) {
        hits.add(doc.doc);
      }
View Full Code Here

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

    // 3. execute the algorithm  (required in every "logic" test)
    Benchmark benchmark = execBenchmark(algLines);

    DirectoryReader r = DirectoryReader.open(benchmark.getRunData().getDirectory());
    SortedDocValues idx = FieldCache.DEFAULT.getTermsIndex(SlowCompositeReaderWrapper.wrap(r), "country");
    final int maxDoc = r.maxDoc();
    assertEquals(1000, maxDoc);
    for(int i=0;i<1000;i++) {
      assertTrue("doc " + i + " has null country", idx.getOrd(i) != -1);
    }
    r.close();
View Full Code Here

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

     
      TestDataDigester testDigester=new TestDataDigester(_fconf,data);
      BoboIndexer indexer=new BoboIndexer(testDigester,idxDir);
      indexer.index();
      IndexReader r = IndexReader.open(idxDir,false);
      r.deleteDocument(r.maxDoc() - 1);
      //r.flush();
      r.close();
    } catch (UnsupportedEncodingException e) {
      e.printStackTrace();
    } catch (IOException e) {
View Full Code Here

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

    Random rand=new Random();
       
    IndexReader reader=null;
    try{
      reader=IndexReader.open(FSDirectory.open(getDataFile()),true);
      int carcount=reader.maxDoc();
     
      Document[] docCache=new Document[carcount];
      for (int i=0;i<carcount;++i){
        docCache[i]=reader.document(i);
      }
View Full Code Here

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

    air = IndexReader.open(aprioriIndex, false);
    tir = testIndex.indexReaderFactory();

    assertEquals(air.isCurrent(), tir.isCurrent());
    assertEquals(air.hasDeletions(), tir.hasDeletions());
    assertEquals(air.maxDoc(), tir.maxDoc());
    assertEquals(air.numDocs(), tir.numDocs());
    assertEquals(air.numDeletedDocs(), tir.numDeletedDocs());

    for (int d =0; d<air.maxDoc(); d++) {
      assertEquals(air.isDeleted(d), tir.isDeleted(d));
View Full Code Here

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

    assertEquals(air.hasDeletions(), tir.hasDeletions());
    assertEquals(air.maxDoc(), tir.maxDoc());
    assertEquals(air.numDocs(), tir.numDocs());
    assertEquals(air.numDeletedDocs(), tir.numDeletedDocs());

    for (int d =0; d<air.maxDoc(); d++) {
      assertEquals(air.isDeleted(d), tir.isDeleted(d));
    }

    air.close();
    tir.close();
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.