internal async Task <bool> IndexIfNeeded(ResolveOptions resOpt) { if (this.NeedsIndexing) { // make the corpus internal machinery pay attention to this document for this call CdmCorpusDefinition corpus = (this.Folder as CdmFolderDefinition).Corpus; await corpus.ResolveImportsAsync(this); // maintain actual current doc corpus.docsNotIndexed.TryAdd(this, 1); return(corpus.IndexDocuments(resOpt, this)); } return(true); }
internal async Task <bool> IndexIfNeeded(ResolveOptions resOpt) { if (this.NeedsIndexing) { // make the corpus internal machinery pay attention to this document for this call CdmCorpusDefinition corpus = (this.Folder as CdmFolderDefinition).Corpus; ConcurrentDictionary <CdmDocumentDefinition, byte> docsJustAdded = new ConcurrentDictionary <CdmDocumentDefinition, byte>(); ConcurrentDictionary <string, byte> docsNotFound = new ConcurrentDictionary <string, byte>(); await corpus.ResolveImportsAsync(this, docsJustAdded, docsNotFound); // maintain actual current doc docsJustAdded[this] = 1; return(corpus.IndexDocuments(resOpt, this, docsJustAdded)); } return(true); }
internal async Task <bool> IndexIfNeeded(ResolveOptions resOpt) { if (this.NeedsIndexing) { if (this.Folder == null) { Logger.Error(nameof(CdmDocumentDefinition), (ResolveContext)this.Ctx, $"Document '{this.Name}' is not in a folder", nameof(IndexIfNeeded)); return(false); } // make the corpus internal machinery pay attention to this document for this call CdmCorpusDefinition corpus = (this.Folder as CdmFolderDefinition).Corpus; await corpus.ResolveImportsAsync(this, resOpt); // maintain actual current doc corpus.documentLibrary.MarkDocumentForIndexing(this); return(corpus.IndexDocuments(resOpt, this)); } return(true); }