Example #1
0
 public void TestScan()
 {
     DocumentIndex index = new DocumentIndex(IndexDir);
     PluginManager plugin = new PluginManager();
     plugin.Load();
     index.PluginManager = plugin;
     index.Add(document1A);
     index.Scan();
     foreach (var doc in index.DocumentIdentity)
     {
         Assert.IsTrue(doc.State == IndexationStates.Indexed, "All documents must be index after a scan");
     }
 }
Example #2
0
 public void TestQuery()
 {
     DocumentIndex index = new DocumentIndex(IndexDir);
     PluginManager plugin = new PluginManager();
     plugin.Load();
     index.PluginManager = plugin;
     index.Add(document1A);
     index.Scan();
     var result = index.Search(
         String.Format("Name:\"{0}\"", Path.GetFileNameWithoutExtension(document1A.FilePath)));
     Assert.IsTrue(result.Count() == 1, "Should found 1 doc, found = {0}", result.Count());
 }
Example #3
0
 public void TestLoadCorePlugin()
 {
     PluginManager pMan = new PluginManager();
     pMan.Load();
     Assert.IsTrue(pMan.IsInitialized, "The plugin manager should be initialized after a load");   
 }
Example #4
0
 public void TestCorePluginAreLoaded()
 {
     PluginManager pMan = new PluginManager();
     pMan.Load();
     Assert.IsTrue(pMan.Parsers.Count() == 3, "There is 3 parser in the LucyLib");
 }
Example #5
0
 /// <summary>
 /// Dispose unmanaged ressource
 /// </summary>
 /// <param name="dispose">Should dispose non managed ressource</param>
 protected virtual void Dispose(bool dispose)
 {
     if (dispose)
     {
         if (indexStore != null)
         {
             indexStore.Dispose();
             indexStore = null;
             PluginManager = null;
             this.DocumentIdentity = null;
             GC.SuppressFinalize(this);
             this.disposed = true;
         }
     }
 }