Package org.apache.lucene.store

Examples of org.apache.lucene.store.RAMDirectory


  writer.setMergeFactor(Integer.MAX_VALUE);
 
  System.out.println("num segments: "+numsegs);
  System.out.println("num reps per segment: "+timesReplicatePerSeg);
  for (int i=0;i<numsegs;++i){
    RAMDirectory ramDir = new RAMDirectory();
    IndexWriter subWriter = new IndexWriter(ramDir,new StandardAnalyzer(Version.LUCENE_CURRENT),MaxFieldLength.UNLIMITED);
    Directory[] multiplier = new Directory[timesReplicatePerSeg];
    for (int k=0;k<timesReplicatePerSeg;++k){
      multiplier[k]=new RAMDirectory(srcDir);
    }
    subWriter.addIndexesNoOptimize(multiplier);
    subWriter.optimize();
    subWriter.close();
 
View Full Code Here


      }
    }
   
  @Override
  protected void setUp() throws Exception {
      directory = new RAMDirectory();
      analyzer = new WhitespaceAnalyzer();
      IndexWriter writer = new IndexWriter(directory, analyzer, true, MaxFieldLength.UNLIMITED);
      Document doc = new Document();
      addMetaDataField(doc,PathHandlerName,new String[]{"/a/b/c","/a/b/d"});
      writer.addDocument(doc);
View Full Code Here

   
    return dataList.toArray(new Document[dataList.size()]);
  }
 
  private Directory createIndex(){
    RAMDirectory idxDir=new RAMDirectory();
   
    try {
      Document[] data=buildData();
     
      TestDataDigester testDigester=new TestDataDigester(_fconf,data);
View Full Code Here

    doTest(req,7,answer,null);

  }
 
  public void testIndexReaderReopen() throws Exception{
    Directory idxDir = new RAMDirectory();
    Document[] docs = buildData();
   
    IndexWriter writer = new IndexWriter(idxDir,new StandardAnalyzer(Version.LUCENE_29),MaxFieldLength.UNLIMITED);
    writer.addDocument(docs[0]);
    writer.optimize();
    writer.commit();
   
    IndexReader idxReader = IndexReader.open(idxDir,true);
    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);
      subWriter.addDocument(doc);
      subWriter.optimize();
      subWriter.close();
      writer.addIndexesNoOptimize(new Directory[]{tmpDir});
View Full Code Here

  public void testTime() throws Exception
  {
    List<FacetHandler<?>> facetHandlers = new ArrayList<FacetHandler<?>>();
    /* Underlying time facet for DynamicTimeRangeFacetHandler */
    facetHandlers.add(new RangeFacetHandler("timeinmillis", new PredefinedTermListFactory(Long.class, DynamicTimeRangeFacetHandler.NUMBER_FORMAT),null));
    Directory idxDir = new RAMDirectory();
    IndexWriter writer = new IndexWriter(idxDir,new StandardAnalyzer(Version.LUCENE_29),MaxFieldLength.UNLIMITED);
   
    long now = System.currentTimeMillis();
    DecimalFormat df = new DecimalFormat(DynamicTimeRangeFacetHandler.NUMBER_FORMAT);
    for(long l=0; l<53; l++)
View Full Code Here

    }
  }
 
  //@Override
  protected void setUp() throws Exception {
    directory = new RAMDirectory();
    analyzer = new WhitespaceAnalyzer();
    writer = new IndexWriter(directory, analyzer, true, MaxFieldLength.UNLIMITED);
    addDoc("1", new String[]{ "aa","bb"}, new String[]{"aaa","aaa"}, new int[]{100,200});
    addDoc("2", new String[]{ "aa","bb"}, new String[]{"aaa","bbb"}, new int[]{200,200});
    addDoc("3", new String[]{ "aa","bb"}, new String[]{"bbb","aaa"}, new int[]{300,300});
View Full Code Here

  }
 
  public FacetHandlerTest(String testname)
  {
    super(testname);
    _ramDir = new RAMDirectory();
    try
    {
      IndexWriter writer = new IndexWriter(_ramDir,new StandardAnalyzer(Version.LUCENE_CURRENT),MaxFieldLength.UNLIMITED);
      writer.close();
    }
View Full Code Here

     
      return dataList.toArray(new Document[dataList.size()]);
  }
 
  private Directory createIndexTwo(){
    Directory dir = new RAMDirectory();
    try {
      Document[] data= createDataTwo();
     
      TestDataDigester testDigester=new TestDataDigester(_facetHandlers,data);
      BoboIndexer indexer=new BoboIndexer(testDigester,dir);
View Full Code Here

    return dir;
  }
 
 
  private Directory createIndex(){
    Directory dir = new RAMDirectory();
    try {
      Document[] data= createData();
     
      TestDataDigester testDigester=new TestDataDigester(_facetHandlers,data);
      BoboIndexer indexer=new BoboIndexer(testDigester,dir);
View Full Code Here

    }
    return dataList.toArray(new Document[dataList.size()]);
}
 
  private Directory createIndex(){
    Directory dir = new RAMDirectory();
    try {
      Document[] data= createData();
     
      TestDataDigester testDigester=new TestDataDigester(_facetHandlers,data);
      BoboIndexer indexer=new BoboIndexer(testDigester,dir);
View Full Code Here

TOP

Related Classes of org.apache.lucene.store.RAMDirectory

Copyright © 2018 www.massapicom. 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.