Examples of optimize()


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

    for (int i = 0; i < contents.length; ++i) {
      Document doc = new Document();
      doc.add(new Field(field, contents[i], Field.Store.YES, Field.Index.ANALYZED));
      writer.addDocument(doc);
    }
    writer.optimize();
    writer.close();

    return indexStore;
  }
View Full Code Here

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

      doc.add(noPayloadField);
      doc.add(new Field("field", English.intToEnglish(i), Field.Store.YES, Field.Index.ANALYZED));
      doc.add(new Field("multiField", English.intToEnglish(i) + "  " + English.intToEnglish(i), Field.Store.YES, Field.Index.ANALYZED));
      writer.addDocument(doc);
    }
    writer.optimize();
    writer.close();

    searcher = new IndexSearcher(directory, true);
    searcher.setSimilarity(similarity);
  }
View Full Code Here

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

      doc.add(new Field("field", English.intToEnglish(i), Field.Store.YES, Field.Index.ANALYZED));
      String txt = English.intToEnglish(i) +' '+English.intToEnglish(i+1);
      doc.add(new Field("field2",  txt, Field.Store.YES, Field.Index.ANALYZED));
      writer.addDocument(doc);
    }
    writer.optimize();
    writer.close();

    searcher = new IndexSearcher(directory, true);
    searcher.setSimilarity(similarity);
  }
View Full Code Here

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

    Directory dir = FSDirectory.open(indexDir);
    final MockRAMDirectory ramDir = new MockRAMDirectory(dir);
    dir.close();
   
    final IndexWriter writer  = new IndexWriter(ramDir, new WhitespaceAnalyzer(), false, IndexWriter.MaxFieldLength.LIMITED);
    writer.optimize();
   
    assertEquals(ramDir.sizeInBytes(), ramDir.getRecomputedSizeInBytes());
   
    Thread[] threads = new Thread[numThreads];
    for (int i=0; i<numThreads; i++) {
View Full Code Here

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

    for (int i=0; i<numThreads; i++)
      threads[i].start();
    for (int i=0; i<numThreads; i++)
      threads[i].join();

    writer.optimize();
    assertEquals(ramDir.sizeInBytes(), ramDir.getRecomputedSizeInBytes());
   
    writer.close();
  }
View Full Code Here

Examples of org.apache.lucene.index.RandomIndexWriter.optimize()

    }
    if (!doMultiSegment) {
      if (VERBOSE) {
        System.out.println("TEST: setUp optimize");
      }
      iw.optimize();
    }
    iw.close();
    if (VERBOSE) {
      System.out.println("TEST: setUp done close");
    }
View Full Code Here

Examples of org.apache.maven.index.context.IndexingContext.optimize()

            nexusIndexer.addIndexingContext( contextId, contextId, repo, repoIndexDir, "http://www.apache.org",
                                             "http://www.apache.org/.index", indexCreators );
        indexingContext.setSearchable( true );
        nexusIndexer.scan( indexingContext, false );

        indexingContext.optimize();

        File managedRepository = new File( repoIndex );
        final File indexLocation = new File( managedRepository, ".index" );
        IndexPackingRequest request = new IndexPackingRequest( indexingContext, indexLocation );
        indexPacker.packIndex( request );
View Full Code Here

Examples of org.apache.pig.experimental.logical.optimizer.LogicalPlanOptimizer.optimize()

                // set uids
                UidStamper stamper = new UidStamper(newPlan);
                stamper.visit();

                LogicalPlanOptimizer optimizer = new LogicalPlanOptimizer(newPlan, 3);
                optimizer.optimize();               
               
                newPlan.explain(lps, format, verbose);
            }
            pp.explain(pps, format, verbose);
            pigContext.getExecutionEngine().explain(pp, eps, format, verbose);
View Full Code Here

Examples of org.apache.pig.experimental.plan.optimizer.PlanOptimizer.optimize()

        Set<Rule> s = new HashSet<Rule>();
        s.add(r);
        List<Set<Rule>> ls = new ArrayList<Set<Rule>>();
        ls.add(s);
        PlanOptimizer optimizer = new MyPlanOptimizer(plan, ls, 3);
        optimizer.optimize();
       
        assertEquals(plan.getPredecessors(filter).get(0), join);
        Operator next = plan.getSuccessors(filter).get(0);
        assertEquals(LOFilter.class, next.getClass());       
        next = plan.getSuccessors(next).get(0);
View Full Code Here

Examples of org.apache.pig.impl.logicalLayer.optimizer.LogicalOptimizer.optimize()

                String msg = "Unable to deserialize optimizer rules.";
                throw new FrontendException(msg, errCode, PigException.BUG, ioe);
            }

            LogicalOptimizer optimizer = new LogicalOptimizer(lp, pigContext.getExecType(), optimizerRules);
            optimizer.optimize();
           
            // compute whether output data is sorted or not
            SortInfoSetter sortInfoSetter = new SortInfoSetter(lp);
            sortInfoSetter.visit();
           
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.