void AddToResult(SearchResult result, Postings found) { foreach (Posting posting in found) { result.Add(new SearchHit(posting.Record)); } }
void SearchToken(SearchResult result, Token token) { Postings postings = (Postings)_postings[token.Value]; if (null != postings) { AddToResult(result, postings); } }
void IndexByToken(Token token, IRecord record, IndexedField field) { Postings postings = (Postings)_postings[token.Value]; if (null == postings) { postings = new Postings(token.Value); _postings[token.Value] = postings; } postings.Add(record, field, token.Position); }
void DumpPostings(Postings[] postings) { System.Diagnostics.Trace.WriteLine("\n**************"); foreach (Postings p in postings) { System.Diagnostics.Trace.WriteLine(p.ToString()); } System.Diagnostics.Trace.WriteLine("**************"); }