Exemplo n.º 1
0
        public void AddDocument(string title, string text)
        {
            Document doc = new Document(text);

            doc.Title = title;
            Docs.Add(doc);
            _searcher.AddDocument(doc);
        }
Exemplo n.º 2
0
        private void LoadSearcher()
        {
            var questions = _context.Question
                            .Include(q => q.Answers)
                            .Include(q => q.QuestionLabels)
                            .ThenInclude(ql => ql.Label)
                            .Include(q => q.User)
                            .Include(q => q.QuestionStudios)
                            .ThenInclude(qs => qs.Studio)
                            .ToList();

            foreach (var question in questions)
            {
                _searcher.AddDocument(question);
            }
        }