public void BuildIndex() { progressRate = 0; //string outputXML; //oneNote.GetHierarchy(null, HierarchyScope.hsPages, out outputXML); lucene.SetWorkingDirectory(); lucene.SetUpWriter(); string outputXML = System.IO.File.ReadAllText(@"D:\\Sample.xml"); BuildIndex(outputXML); lucene.CloseWriter(); }
/// <summary> /// Add or update index in lucene. /// </summary> /// <param name="useCache">Indicate use previous cache or do a clean index.</param> public void BuildIndex(bool useCache, string indexMode) { progressRate = 0; lucene.SetWorkingDirectory(); if (useCache) { AddIndexByTime(indexMode); } else { AddAllIndex(indexMode); } lucene.CloseWriter(); }