示例#1
0
        public void Add(DocumentPosting other)
        {
            if (other.DocumentId != DocumentId)
            {
                throw new ArgumentException("other");
            }

            Count += other.Count;
        }
示例#2
0
        public DocumentPosting Join(DocumentPosting other)
        {
            if (other.DocumentId != DocumentId)
            {
                throw new ArgumentException();
            }

            return(new DocumentPosting(DocumentId, Count + other.Count));
        }
示例#3
0
        public void Add(string key, string value, DocumentPosting posting)
        {
            _timer.Start();

            LcrsTrie trie;

            var hashedKey = key.ToHash();

            if (!_tries.TryGetValue(hashedKey, out trie))
            {
                trie = new LcrsTrie();
                _tries.Add(hashedKey, trie);
            }

            trie.Add(value, 0, posting);
        }
示例#4
0
 public WordInfo(string field, string token, DocumentPosting posting)
 {
     Field   = field;
     Token   = token;
     Posting = posting;
 }