Ejemplo n.º 1
0
        private void Update()
        {
            var content = ContentApi.NeedIndexing();
            var vms     = content.Select(c => c.AsViewModel().WithUser());

            Searcher.Instance.Index(vms.Select(c => new Searchable()
            {
                Id = c.Id, Title = c.Title, Body = c.Body, Type = c.Type, Username = c.User.DisplayName
            }));

            foreach (var c in content)
            {
                ContentApi.MarkAsIndexed(c.Id);
            }
        }