Esempio n. 1
0
        public async Task ReindexAsync()
        {
            var docs = await _documentRepository.GetListAsync();

            var projects = await _projectRepository.GetListAsync();

            foreach (var doc in docs)
            {
                var project = projects.FirstOrDefault(x => x.Id == doc.ProjectId);
                if (project == null)
                {
                    continue;
                }

                if (doc.FileName == project.NavigationDocumentName)
                {
                    continue;
                }

                if (doc.FileName == project.ParametersDocumentName)
                {
                    continue;
                }

                await _documentFullSearch.AddOrUpdateAsync(doc);
            }
        }
 private async Task AddOrUpdate(Document document)
 {
     if (_options.Enable)
     {
         await _documentFullSearch.AddOrUpdateAsync(document);
     }
 }
Esempio n. 3
0
        private async Task ReindexProjectAsync(Guid projectId)
        {
            var project = await _projectRepository.FindAsync(projectId);

            if (project == null)
            {
                throw new Exception("Cannot find the project with the Id " + projectId);
            }

            var docs = await _documentRepository.GetListByProjectId(project.Id);

            await _elasticSearchService.DeleteAllByProjectIdAsync(project.Id);

            foreach (var doc in docs)
            {
                if (doc.FileName == project.NavigationDocumentName)
                {
                    continue;
                }

                if (doc.FileName == project.ParametersDocumentName)
                {
                    continue;
                }

                await _elasticSearchService.AddOrUpdateAsync(doc);
            }
        }
Esempio n. 4
0
        public async Task ReindexAsync(Guid documentId)
        {
            await _documentFullSearch.DeleteAsync(documentId);

            var document = await _documentRepository.GetAsync(documentId);

            await _documentFullSearch.AddOrUpdateAsync(document);
        }
Esempio n. 5
0
        public async Task ReindexAsync(Guid documentId)
        {
            _elasticSearchService.ValidateElasticSearchEnabled();

            await _elasticSearchService.DeleteAsync(documentId);

            var document = await _documentRepository.GetAsync(documentId);

            await _elasticSearchService.AddOrUpdateAsync(document);
        }
Esempio n. 6
0
        public async Task ReindexAsync(ReindexInput input)
        {
            var project = await _projectRepository.GetAsync(input.ProjectId);

            await _documentFullSearch.DeleteAllByProjectIdAsync(project.Id);

            var docs = await _documentRepository.GetListByProjectId(project.Id);

            foreach (var doc in docs)
            {
                if (doc.FileName == project.NavigationDocumentName)
                {
                    continue;
                }

                if (doc.FileName == project.ParametersDocumentName)
                {
                    continue;
                }

                await _documentFullSearch.AddOrUpdateAsync(doc);
            }
        }