public DocumentHierarchySearcher CreateDocumentHierarchySearcher(string path) { if (string.IsNullOrEmpty(path)) { return null; } DocumentHierarchy = new DocumentHierarchy(new RootNode(path)); return new DocumentHierarchySearcher(DocumentHierarchy); }
public DocumentHierarchySearcher CreateDocumentHierarchySearcher(string path, bool analyzeContents) { if (string.IsNullOrEmpty(path)) { return null; } this.DocumentHierarchy = new DocumentHierarchy(new RootNode(path), analyzeContents); return new DocumentHierarchySearcher(this.DocumentHierarchy); }
public INode GetFunctionNodeByName(DocumentHierarchy documentHierarchy, string name) { if (documentHierarchy == null) { return null; } return documentHierarchy .SearchNodesByTerm(name, FullTextFieldType.NameNotAnalyzed) .Select(result => result.Node) .FirstOrDefault(node => node.NodeType != NodeType.Directory && node.NodeType != NodeType.File && node.NodeType != NodeType.Intermediate); }
// note: can be invoked by multiple threads simultaneously public INode GetDocumentHierarchyViewNodeProjection(DocumentHierarchy documentHierarchy, string path, SearchOptions searchOptions, BackgroundWorker worker) { if (documentHierarchy == null) { return null; } var node = path == null ? documentHierarchy.RootNode : documentHierarchy.GetNode(path); if (node == null || String.IsNullOrWhiteSpace(searchOptions.SearchText)) { return node; } IList<INode> filteredNodes = documentHierarchy .SearchNodesFullText(searchOptions) .Where(result => result.Path.StartsWith(node.Path)) // TODO: filter it earlier for performance .Select(result => result.Node) .ToList(); this.ReportProgress(worker); return this.FillNewFilteredDocumentHierarchyRecursively(filteredNodes, node, null, worker); }
public DocumentHierarchyIndexer(DocumentHierarchy documentHierarchy) { this.DocumentHierarchy = documentHierarchy; }
public DocumentHierarchySearcher(DocumentHierarchy documentHierarchy) { this.DocumentHierarchy = documentHierarchy; }
public BackgroundSearcherParams(DocumentHierarchy documentHierarchy, SearchOptions searchOptions, string path) { this.DocumentHierarchy = documentHierarchy; this.SearchOptions = new SearchOptions(searchOptions); this.Path = path; }