public override HashSet <Document> GetResults(IInvertedIndex index) { var results = new HashSet <Document>(); if (Tokens.Any()) { results.UnionWith(index.GetDocumentsOfToken(Tokens[0])); Tokens.ForEach(t => results.IntersectWith(index.GetDocumentsOfToken(t))); } return(results); }
public override HashSet <Document> GetResults(IInvertedIndex index) { var results = new HashSet <Document>(); Tokens.ForEach(t => results.UnionWith(index.GetDocumentsOfToken(t))); return(results); }
public override HashSet <Document> GetResults(IInvertedIndex index) { return(new HashSet <Document>(Tokens.SelectMany(token => index.GetDocumentsOfToken(token)))); }