public static void Add(this CrawledTrie <CrawledIssue> trie, CrawledIssue issue) { var terms = issue.GetTrieTerms(); foreach (var term in terms) { trie.Add(term, issue); } }
public static IEnumerable <string> GetTrieTerms(this CrawledIssue issue) { var result = new SortedSet <string>(StringComparer.OrdinalIgnoreCase); AddTermsFromMarkdown(result, issue.Title); // TODO: Should we index the body or not? // AddTermsFromMarkdown(result, issue.Body); result.Add($"org:{issue.Repo.Org}"); result.Add($"repo:{issue.Repo.Name}"); result.Add($"repo:{issue.Repo.FullName}"); result.Add($"author:{issue.CreatedBy}"); foreach (var assignee in issue.Assignees) { result.Add($"assignee:{assignee}"); } foreach (var label in issue.Labels) { result.Add($"label:{label.Name}"); } foreach (var area in issue.Areas) { result.Add($"area-under:{area}"); } foreach (var areaNode in issue.AreaNodes) { result.Add($"area-node:{areaNode}"); } foreach (var areaLead in issue.AreaLeads) { result.Add($"area-lead:{areaLead}"); } foreach (var areaOwner in issue.AreaOwners) { result.Add($"area-owner:{areaOwner}"); } if (issue.Milestone is not null) { result.Add($"milestone:{issue.Milestone.Title}"); } return(result); }
public CrawledIssueOrGroup(CrawledIssue issue) { _value = issue; }