Example #1
0
 private async Task IndexLanguageVersions(ContentReference contentReference, IndexContentRequest indexContentRequest)
 {
     foreach (var languageVersion in _contentLoader.GetAllLanguageVersions(contentReference).Where(c => c.ShouldIndexPage()))
     {
         indexContentRequest.OnStatusChanged($"Indexing content: Name: {languageVersion.Name}, ContentLinkId: {languageVersion.ContentLink.ID}");
         var contentDocument = _documentBuilder.Build(languageVersion);
         await _azureSearchService.IndexAsync(contentDocument);
     }
 }
Example #2
0
        private IReadOnlyCollection <T> GetPageAllLanguagesContentDocuments(ContentReference contentLink, bool includeDeleted = false)
        {
            var contentInAllLanguages = _contentLoader.GetAllLanguageVersions(contentLink);
            var documents             = contentInAllLanguages
                                        .Where(c => (includeDeleted && c.IsDeleted) || c.ShouldIndexPage())
                                        .Select(_contentDocumentBuilder.Build)
                                        .ToList();

            return(documents);
        }