Ejemplo n.º 1
0
  public void setUp() throws Exception {
    super.setUp();

    config =
        SimpleCentralConfig.create(
            StorageFac.createToMongo("61.250.201.78", "search", "storageTest"));
  }
Ejemplo n.º 2
0
 public void testSpeed() throws Exception {
   Directory[] dirs =
       new Directory[] {
         StorageFac.createToMongo("61.250.201.78", "search", "storageTest"),
         new MMapDirectory(new File("c:/temp/"))
       };
   for (Directory dir : dirs) {
     long start = System.currentTimeMillis();
     indexSpeed(dir);
     Debug.line(dir.getClass(), System.currentTimeMillis() - start);
   }
 }
Ejemplo n.º 3
0
  public void testApply() throws Exception {
    Central c = writeDocument(config, analyzer);

    Central newC =
        SimpleCentralConfig.createCentral(
            StorageFac.createToMongo("61.250.201.78", "search", "storageTest"));
    newC.newSearcher().search("bleujin").debugPrint();
    Debug.line('@', config.buildDir().getLockID(), newC.dir().getLockID());

    Indexer writer = c.newIndexer();
    writer.index(
        analyzer,
        new IndexJob<Void>() {
          public Void handle(IndexSession session) throws Exception {
            session.insertDocument(MyDocument.testDocument().keyword("name", "bleujin"));
            return null;
          }
        });

    newC.newSearcher().search("bleujin").debugPrint();
    Debug.line();
  }