indexer.go 445 B

1234567891011121314151617181920
  1. package dao
  2. import (
  3. "github.com/go-ego/riot/types"
  4. )
  5. // Insert doc into index...
  6. func (d *Dao) Insert(id uint64, content string, forceUpdate bool) {
  7. d.searcher.Index(id, types.DocData{Content: content}, forceUpdate)
  8. }
  9. // Flush force update data from cache to index
  10. func (d *Dao) Flush() {
  11. d.searcher.Flush()
  12. }
  13. // Remove remove a doc from index
  14. func (d *Dao) Remove(id uint64, forceUpdate bool) {
  15. d.searcher.RemoveDoc(id, forceUpdate)
  16. }