Exemplo n.º 1
0
        public IHttpActionResult Index(string fileName, int maxItems = 1000)
        {
            var service = new ElasticIndexService();

            service.CreateIndex(fileName, maxItems);
            return(Ok());
        }
Exemplo n.º 2
0
        public IHttpActionResult Index()
        {
            var indexService = new ElasticIndexService();

            indexService.CreateIndex();
            return(Ok());
        }
Exemplo n.º 3
0
        public Microsoft.AspNetCore.Mvc.OkResult Index(string fileName, int maxItems = 1000)
        {
            var indexService = new ElasticIndexService(_env);

            indexService.CreateIndex(fileName, maxItems);
            return(Ok());
        }
        public ActionResult ReIndexElastic()
        {
            ElasticIndexService elasticService = new ElasticIndexService();

            var list = (wRepository.Worktasks).ToList();

            //list.IncludeAllAttachmentObject();
            // Include all Attachment to relevant task. This will take time so maybe you should use a Join statement
            //to save performance here!!!
            foreach (var task in list)
            {
                task.loadMetaInfo(wRepository, accRepository);
                List <TMS.Domain.Entities.Attachment> attachmentList = wRepository.Attachments.Where(att => att.WorktaskID == task.WorktaskID).ToList();
                task.Attachment = null;

                // Refer to new attachment
                task.Attachment = attachmentList;
            }

            elasticService.CreateIndex(list);

            return(RedirectToAction("Index", "Admin"));
        }