示例#1
0
		public override void Run (IEnumerable<string> args)
		{
			string rootPath = null;

			var options = new OptionSet () {
				{ "r=|root=", "Specify which documentation root to use. Default is $libdir/monodoc", v => rootPath = v },
			};

			var extra = Parse (options, args, "index", 
			                   "[OPTIONS]+ ACTION",
			                   "Create Monodoc indexes depending on ACTION. Possible values are \"tree\" or \"search\" for, respectively, mdoc tree and lucene search");
			if (extra == null)
				return;

			var root = string.IsNullOrEmpty (rootPath) ? RootTree.LoadTree () : RootTree.LoadTree (rootPath);

			foreach (var action in extra) {
				switch (action) {
				case "tree":
					RootTree.MakeIndex (root);
					break;
				case "search":
					RootTree.MakeSearchIndex (root);
					break;
				}
			}
		}
 public void PerformSearchIndexCreation()
 {
     FireSearchIndexCreationEvent(true);
     RootTree.MakeSearchIndex();
     RootTree.MakeIndex();
     IsFresh = true;
     FireSearchIndexCreationEvent(false);
     if (md5sums != null)
     {
         SerializeDictionary(Path.Combine(baseUserDir, sumFile), md5sums);
     }
 }
示例#3
0
 public void PerformSearchIndexCreation()
 {
     FireSearchIndexCreationEvent(true);
     try {
         RootTree.MakeSearchIndex();
     } catch (Exception e) {
         Logger.LogError("Error making search index", e);
     }
     try {
         RootTree.MakeIndex();
     } catch (Exception e) {
         Logger.LogError("Error making normal index", e);
     }
     IsFresh = true;
     FireSearchIndexCreationEvent(false);
     if (md5sums != null)
     {
         SerializeDictionary(Path.Combine(baseUserDir, sumFile), md5sums);
     }
 }