Ejemplo n.º 1
0
        /// <summary>
        /// Opens the index.
        /// </summary>
        /// <param name="IndexID">The index identifier.</param>
        /// <param name="sessionId">The session identifier.</param>
        /// <returns></returns>
        public indexPerformanceEntry OpenIndex(string IndexID, string sessionId = "*")
        {
            string pi = PATH_PageIndex;
            string di = PATH_DomainIndex;
            string es = PATH_ExperimentSessions;

            folder = new folderNode(PATH_MainFolder, "Global Index", "Folder for Global Index data");

            indexSessionRecords = new indexPerformanceRecord(folder.pathFor(PATH_IndexPerformance), doAutoLoad);

            if (sessionId == "*")
            {
                sessionId = experimentSessionRegistry.GENERAL_SESSIONID;
            }

            if (IndexID == "*" || IndexID == indexPerformanceEntry.GLOBAL_IndexRepository)
            {
            }
            else
            {
                folder = new folderNode(PATH_MainFolder.add(IndexID, "\\"), "Local Index", "Folder for Local Index (" + IndexID + ") data");

                pi = folder.pathFor(IndexID.getCleanFilePath() + "\\" + pi);
                di = folder.pathFor(IndexID.getCleanFilePath() + "\\" + di);
                es = folder.pathFor(IndexID.getCleanFilePath() + "\\" + es);
            }

            pageIndexTable   = new indexPageTable(folder.pathFor(pi), doAutoLoad);
            domainIndexTable = new indexDomainTable(folder.pathFor(di), doAutoLoad);

            if (imbWEMManager.settings.indexEngine.doRunIndexInReadOnlyMode)
            {
                pageIndexTable.ReadOnlyMode   = true;
                domainIndexTable.ReadOnlyMode = true;
            }
            experimentManager = new experimentSessionRegistry(sessionId, folder.pathFor(es), doAutoLoad);
            current_indexID   = IndexID;

            plugins           = new indexPlugInCollection(experimentEntry);
            plugins.IsEnabled = false;

            lastIndexSave = DateTime.Now;
            return(indexSessionEntry);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the session.
        /// </summary>
        /// <param name="sessionId">The session identifier.</param>
        /// <param name="crawlId">The crawl identifier.</param>
        /// <returns></returns>
        public indexPerformanceEntry StartSession(string crawlId, ICrawlJobContext state = null)
        {
            indexSessionEntry                 = indexSessionRecords.GetOrCreate(DateTime.Now.ToShortDateString() + "-" + DateTime.Now.ToShortTimeString());
            indexSessionEntry.SessionID       = experimentManager.SessionID;
            indexSessionEntry.CrawlID         = crawlId;
            indexSessionEntry.IndexRepository = current_indexID;
            indexSessionEntry.Start           = DateTime.Now;


            experimentEntry   = experimentManager.StartSession(crawlId, indexSessionEntry, state);
            plugins           = new indexPlugInCollection(experimentEntry);
            plugins.IsEnabled = true;
            domainIndexTable.deploySession();
            //imbWEMManager.index.experimentManager.globalTFIDFSet.GetAggregateDataTable().saveObjectToXML(folder.pathFor("TFIFD_aggregate"));

            if (imbWEMManager.settings.indexEngine.doIndexPublishAndBackupOnOpenSession)
            {
                Publish(imbWEMManager.authorNotation, experimentEntry.indexSubFolder);
            }

            return(indexSessionEntry);
        }