Esempio n. 1
0
        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);
        }
Esempio n. 2
0
        public override HashSet <Document> GetResults(IInvertedIndex index)
        {
            var results = new HashSet <Document>();

            Tokens.ForEach(t => results.UnionWith(index.GetDocumentsOfToken(t)));
            return(results);
        }
Esempio n. 3
0
 public override HashSet <Document> GetResults(IInvertedIndex index)
 {
     return(new HashSet <Document>(Tokens.SelectMany(token => index.GetDocumentsOfToken(token))));
 }