Exemplo n.º 1
0
        private IEnumerable <IList <DocumentPosting> > ReadPostings(IEnumerable <Term> terms)
        {
            var addresses = terms.Select(term => term.Word.PostingsAddress)
                            .OrderBy(adr => adr.Position).ToList();

            using (var postingsReader = new PostingsReader(
                       new FileStream(_posFileName, FileMode.Open, FileAccess.Read, FileShare.Read, 4096 * 1, FileOptions.SequentialScan)))
            {
                var postings = postingsReader.Read(addresses).SelectMany(x => x).ToList();

                yield return(postings);
            }
        }
Exemplo n.º 2
0
 private IEnumerable <IList <DocumentPosting> > ReadPostings(IEnumerable <Term> terms)
 {
     return(PostingsReader.ReadPostings(_directory, _ix, terms));
 }