コード例 #1
0
ファイル: Program.cs プロジェクト: zhaosiqi/MyDemoCode
        private static void Index()
        {
            IndexHelper indexHelper = new IndexHelper(Config.IndexFolder, Config.TextFilesFolder);

            indexHelper.CreateIndex(new PanGuAnalyzer());
            Console.WriteLine("索引完成!");
        }
コード例 #2
0
        public object Any(Ask request)
        {
            AskResponse response = new AskResponse();

            response.Result = ErrorCode.OK;

            Guid creatorId = UserSession.GetUserId();

            DateTime      dateTime      = DateTime.UtcNow;
            QuestionEntry questionEntry = new QuestionEntry(creatorId, Guid.NewGuid())
            {
                Title        = request.Title,
                Detail       = request.Detail,
                Creation     = dateTime,
                Modification = dateTime,
                Tags         = string.Join(",", request.Tags).ToLowerInvariant()
            };

            TableRepository tableRepository = new TableRepository();

            tableRepository.InsertOrReplace(questionEntry, Tables.Questions);

            IndexHelper.CreateIndex(questionEntry.GetId(), request.Title + " " + questionEntry.Tags, Tables.Questions);

            return(response);
        }
コード例 #3
0
ファイル: Form1.cs プロジェクト: zhaosiqi/MyDemoCode
 private void _bgWorker_DoWork(object sender, DoWorkEventArgs e)
 {
     _indexHelper.CreateIndex();
 }