Esempio n. 1
0
func (p *Posting) Search(arg *document.DocumentArg, result *document.SearchMap) error {
	doc, err := arg.GetDocument(p.registry)
	if err != nil {
		return newPostingError("Search Document:", err)
	}
	p.lock.RLock()
	defer p.lock.RUnlock()
	return p.search(doc, result)
}
Esempio n. 2
0
func (p *Posting) Delete(arg *document.DocumentArg, _ *struct{}) error {
	doc, err := arg.GetDocument(p.registry)
	if err != nil {
		return newPostingError("Delete Document:", err)
	}
	p.lock.Lock()
	defer p.lock.Unlock()
	return p.alter(Delete, doc)
}