/// <summary> /// ����һ��ģ�� /// </summary> /// <param name="mpathc">ģ��·��</param> /// <param name="nm">����</param> /// <param name="modName">ģ������</param> private void CompModIt(string mpathc, Hashtable nm,string modName) { nSearch.ClassLibraryHTML.ClassHTML mHtm = new nSearch.ClassLibraryHTML.ClassHTML(); //����Ԥ���� ����������� Hashtable nT = new Hashtable (); nT.Clear(); foreach (DictionaryEntry HI in nm) { string url = HI.Key.ToString(); nSearch.DebugShow.onePage nnt_mp = (nSearch.DebugShow.onePage)mHtm.GetOnePage(HI.Value.ToString(), url); string HtmDat = nnt_mp.Body; //ȡ��Title��� Body �ֿ����� ���Ч�� //Title�Զ���Ϊ��0�� �������� nT.Add(url, HtmDat); } nSearch.DebugShow.ClassDebugShow.WriteLineF(" ���ݼ������ "); //�͵����������д��� TMM(nT, mpathc+modName); //������ }
/// <summary> /// ��ʼ���� /// </summary> private void RunStart() { nSearch.DebugShow.ClassDebugShow.WriteLineF(" ��ʼ������"); //�Ѿ����ڵĻ�Ϊ���� if (System.IO.File.Exists(indexDirectory + "segments") == true) { writer = new IndexWriter(indexDirectory, OneAnalyzer, false); } else { writer = new IndexWriter(indexDirectory, OneAnalyzer, true); } string AIDStart = getFileData(idp_filename); if (AIDStart.Length > 0) { XX_AIDStart = Int32.Parse(AIDStart); } else { XX_AIDStart = 0; } writer.SetUseCompoundFile(true); writer.SetMaxBufferedDocs(100); writer.SetMergeFactor(100); nSearch.DebugShow.ClassDebugShow.WriteLineF(" ��ʼ������[OK]"); //�ļ�ID���ձ� //ArrayList mID = nSearch.FS.ClassFSMD.GetUrlList(); int iii = nSearch.FS.ClassFSMD.GetFileNum(); nSearch.ClassLibraryHTML.ClassHTML myTag = new nSearch.ClassLibraryHTML.ClassHTML(); //ѭ�� for (int i = XX_AIDStart; i < iii; i++) { if (i == 19) { int uu = 0; } nSearch.FS.oneHtmDat newDat = nSearch.FS.ClassFSMD.GetOneDat(i); nSearch.DebugShow.onePage mmm = (nSearch.DebugShow.onePage)myTag.GetOnePage(newDat.HtmDat, newDat.url); Lucene.Net.Documents.Document doc = nSearch.ModelData.ClassModelData.GetOneDoc(newDat.url, mmm.Title, mmm.Body,0); nSearch.DebugShow.ClassDebugShow.WriteLineF("==����-> " + i.ToString()); writer.AddDocument(doc); nSearch.DebugShow.ClassDebugShow.WriteLineF("++����-> "+i.ToString()); XX_AIDStart = i; if (i % 200 == 46) { nSearch.DebugShow.ClassDebugShow.WriteLineF("���浱ǰ�������ļ�λ��ָ��-> " + i.ToString()); putFileData(idp_filename, XX_AIDStart.ToString()); } } XX_AIDStart = XX_AIDStart + 1; nSearch.DebugShow.ClassDebugShow.WriteLineF("���浱ǰ�������ļ�λ��ָ��-> " + XX_AIDStart.ToString()); putFileData(idp_filename, XX_AIDStart.ToString()); writer.Optimize(); writer.Close(); nSearch.DebugShow.ClassDebugShow.WriteLineF(" ����[OK]"); }
private void comboBox_f_SelectedIndexChanged(object sender, EventArgs e) { if (comboBox_f.Text.Length > 0) { string aurl = comboBox_f.Text; int id = -1; for (int uiy = 0; uiy < mID.Count; uiy++) { if (aurl == mID[uiy].ToString()) { id = uiy; break; } } if (id > -1) { string newDat = nSearch.FS.ClassFSMD.GetOneDat(id).HtmDat; nSearch.ClassLibraryHTML.ClassHTML myTag = new nSearch.ClassLibraryHTML.ClassHTML(); nSearch.DebugShow.onePage mmm = (nSearch.DebugShow.onePage)myTag.GetOnePage(newDat, ""); textBox7.Text = mmm.Body; } } }