Package org.springmodules.lucene.index.factory

Examples of org.springmodules.lucene.index.factory.SimpleIndexFactory


      }
    }
  }

  final public void testGetSearcherWithIndexFactories() throws Exception {
    SimpleIndexFactory indexFactory1 = new SimpleIndexFactory();
    indexFactory1.setDirectory(directory1);
    SimpleIndexFactory indexFactory2 = new SimpleIndexFactory();
    indexFactory2.setDirectory(directory2);

    MultipleSearcherFactory searcherFactory = new MultipleSearcherFactory();
    searcherFactory.setIndexFactories(new IndexFactory[] {indexFactory1, indexFactory2});

    LuceneSearcher searcher = null;
View Full Code Here


      }
    }
  }

  final public void testGetSearcherWithDirectoryAndIndexFactory() throws Exception {
    SimpleIndexFactory indexFactory1 = new SimpleIndexFactory();
    indexFactory1.setDirectory(directory1);

    MultipleSearcherFactory searcherFactory = new MultipleSearcherFactory();
    searcherFactory.setIndexFactories(new IndexFactory[] {indexFactory1});
    searcherFactory.setDirectories(new Directory[] {directory2});
View Full Code Here

    }
  }

  public void testGetResourceFactory() throws Exception {
    RAMDirectory directory = new RAMDirectory();
    SimpleIndexFactory targetIndexFactory = new SimpleIndexFactory();
    targetIndexFactory.setDirectory(directory);
    targetIndexFactory.setCreate(true);
    initIndex(targetIndexFactory);
   
    LockIndexFactory indexFactory = null;
    try {
      indexFactory = new LockIndexFactory();
View Full Code Here

   
    return directory;
  }

  protected IndexFactory createIndexFactory(RAMDirectory directory) throws Exception {
    SimpleIndexFactory indexFactory = new SimpleIndexFactory();
    indexFactory.setDirectory(directory);
    indexFactory.setAnalyzer(new SimpleAnalyzer());
    return indexFactory;
  }
View Full Code Here

  private void testRamDirectoryCreation(ApplicationContext context, Analyzer analyzer) {
    RAMDirectory directory1 = (RAMDirectory)context.getBean("ramDirectory-ramDirectory1");
    assertNotNull(directory1);
   
    SimpleIndexFactory indexFactory1 = (SimpleIndexFactory)context.getBean("ramDirectory1");
    assertNotNull(indexFactory1);
    assertSame(directory1, indexFactory1.getDirectory());
    assertSame(analyzer, indexFactory1.getAnalyzer());

    RAMDirectory directory2 = (RAMDirectory)context.getBean("ramDirectory-ramDirectory2");
    assertNotNull(directory2);
   
    SimpleIndexFactory indexFactory2 = (SimpleIndexFactory)context.getBean("ramDirectory2");
    assertNotNull(indexFactory2);
    assertNotNull(indexFactory2.getDirectory());
    assertSame(directory2, indexFactory2.getDirectory());
    assertNotNull(indexFactory2.getAnalyzer());
    assertNotSame(analyzer, indexFactory2.getAnalyzer());
  }
View Full Code Here

  private void testFSDirectoryCreation(ApplicationContext context, Analyzer analyzer) {
    FSDirectory directory1 = (FSDirectory)context.getBean("fsDirectory-fsDirectory1");
    assertNotNull(directory1);
    assertNotNull(directory1.getFile());
   
    SimpleIndexFactory indexFactory1 = (SimpleIndexFactory)context.getBean("fsDirectory1");
    assertNotNull(indexFactory1);
    assertSame(directory1, indexFactory1.getDirectory());
    assertSame(analyzer, indexFactory1.getAnalyzer());

    FSDirectory directory2 = (FSDirectory)context.getBean("fsDirectory-fsDirectory2");
    assertNotNull(directory2);
    assertNotNull(directory2.getFile());

    SimpleIndexFactory indexFactory2 = (SimpleIndexFactory)context.getBean("fsDirectory2");
    assertNotNull(indexFactory2);
    assertNotNull(indexFactory2.getDirectory());
    assertSame(directory2, indexFactory2.getDirectory());
    assertNotNull(indexFactory2.getAnalyzer());
    assertNotSame(analyzer, indexFactory2.getAnalyzer());
  }
View Full Code Here

    FSDirectory directory2 = (FSDirectory)context.getBean("fsDirectory-fsDirectory2");
    assertNotNull(directory2);
    assertNotNull(directory2.getFile());
   
    SimpleIndexFactory indexFactory2 = (SimpleIndexFactory)context.getBean("target-fsDirectory2");
    assertNotNull(indexFactory2);
    assertSame(directory2, indexFactory2.getDirectory());
    assertSame(analyzer, indexFactory2.getAnalyzer());

    LockIndexFactory channelIndexFactory2 = (LockIndexFactory)context.getBean("fsDirectory2");
    assertNotNull(channelIndexFactory2);
    assertSame(indexFactory2, channelIndexFactory2.getTargetIndexFactory());

    //Directories 3 & 4
    /*FSDirectory directory3 = (FSDirectory)context.getBean("fsDirectory-fsDirectory3");
    assertNotNull(directory3);
    assertNotNull(directory3.getFile());

    SimpleIndexFactory indexFactory3 = (SimpleIndexFactory)context.getBean("target-fsDirectory3");
    assertNotNull(indexFactory3);
    assertNotNull(indexFactory3.getDirectory());
    assertSame(directory3, indexFactory3.getDirectory());
    assertNotNull(indexFactory3.getAnalyzer());
    assertNotSame(analyzer, indexFactory3.getAnalyzer());

    ChannelIndexFactory channelIndexFactory3 = (ChannelIndexFactory)context.getBean("fsDirectory3");
    assertNotNull(channelIndexFactory3);
    assertSame(indexFactory3, channelIndexFactory3.getTargetIndexFactory());*/

    FSDirectory directory4 = (FSDirectory)context.getBean("fsDirectory-fsDirectory4");
    assertNotNull(directory4);
    assertNotNull(directory4.getFile());

    SimpleIndexFactory indexFactory4 = (SimpleIndexFactory)context.getBean("target-fsDirectory4");
    assertNotNull(indexFactory4);
    assertNotNull(indexFactory4.getDirectory());
    assertSame(directory4, indexFactory4.getDirectory());
    assertNotNull(indexFactory4.getAnalyzer());
    assertNotSame(analyzer, indexFactory4.getAnalyzer());

    LockIndexFactory channelIndexFactory4 = (LockIndexFactory)context.getBean("fsDirectory4");
    assertNotNull(channelIndexFactory4);
    assertSame(indexFactory4, channelIndexFactory4.getTargetIndexFactory());
  }
View Full Code Here

      }
    }
  }

  final public void testGetSearcherWithIndexFactory() throws Exception {
    SimpleIndexFactory indexFactory = new SimpleIndexFactory();
    indexFactory.setDirectory(directory);

    SimpleSearcherFactory searcherFactory = new SimpleSearcherFactory();
    searcherFactory.setIndexFactory(indexFactory);

    LuceneSearcher searcher = null;
View Full Code Here

      }
    }
  }

  final public void testGetSearcherWithIndexFactories() throws Exception {
    SimpleIndexFactory indexFactory1 = new SimpleIndexFactory();
    indexFactory1.setDirectory(directory1);
    SimpleIndexFactory indexFactory2 = new SimpleIndexFactory();
    indexFactory2.setDirectory(directory2);

    ParallelMultipleSearcherFactory searcherFactory = new ParallelMultipleSearcherFactory();
    searcherFactory.setIndexFactories(new IndexFactory[] {indexFactory1, indexFactory2});

    LuceneSearcher searcher = null;
View Full Code Here

      }
    }
  }

  final public void testGetSearcherWithDirectoryAndIndexFactory() throws Exception {
    SimpleIndexFactory indexFactory1 = new SimpleIndexFactory();
    indexFactory1.setDirectory(directory1);

    ParallelMultipleSearcherFactory searcherFactory = new ParallelMultipleSearcherFactory();
    searcherFactory.setIndexFactories(new IndexFactory[] {indexFactory1});
    searcherFactory.setDirectories(new Directory[] {directory2});
View Full Code Here

TOP

Related Classes of org.springmodules.lucene.index.factory.SimpleIndexFactory

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.