func Getall(all bool) {
	const searchNodes = 100
	var begin int64
	if cfg.RecentRange > 0 && !all {
		begin = time.Now().Unix() - cfg.RecentRange
	}
	nodes := manager.Random(nil, searchNodes)
	var wg sync.WaitGroup
	for _, n := range nodes {
		wg.Add(1)
		go get(begin, &wg, n)
	}
	wg.Wait()
	suggest.Prune(GetRecords())
}
Getall retrieves Recent records from nodes in searchlist and stores them.
tags are shuffled and truncated to tagsize and stored to sugtags in cache.
also source nodes are stored into lookuptable.
also tags which Recentlist doen't have in sugtagtable are truncated
package recentlist
import (
	"errors"
	"log"
	"strconv"
	"strings"
	"sync"
	"time"
	"encoding/json"
	"github.com/boltdb/bolt"
	"github.com/shingetsu-gou/shingetsu-gou/cfg"
	"github.com/shingetsu-gou/shingetsu-gou/db"
	"github.com/shingetsu-gou/shingetsu-gou/node"
	"github.com/shingetsu-gou/shingetsu-gou/node/manager"
	"github.com/shingetsu-gou/shingetsu-gou/record"
	"github.com/shingetsu-gou/shingetsu-gou/tag/suggest"
)
const defaultUpdateRange = 24 * time.Hour  
func IsInUpdateRange(nstamp int64) bool {
	now := time.Now()
	if now.Add(-defaultUpdateRange).Unix() < nstamp && nstamp < now.Add(defaultUpdateRange).Unix() {
		return true
	}
	return false
}
func Datfiles() []string {
	var datfile []string
	err := db.DB.View(func(tx *bolt.Tx) error {
		var err error
		datfile, err = db.GetPrefixs(tx, "recent")
		return err
	})
	if err != nil {
		log.Print(err)
	}
	return datfile
}
func Newest(datfile string) (*record.Head, error) {
	var rows []string
	err := db.DB.View(func(tx *bolt.Tx) error {
		var err error
		rows, err = db.GetStrings(tx, "recent", []byte(datfile))
		return err
	})
	if err != nil {
		log.Print(err)
		return nil, err
	}
	if len(rows) == 0 {
		return nil, errors.New("not found")
	}
	newest := []byte(rows[len(rows)-1])
	r := record.Head{}
	err = json.Unmarshal(newest, &r)
	if err != nil {
		log.Println(err)
	}
	return &r, err
}
func appendHead(tx *bolt.Tx, rec *record.Head) {
	if find(rec) {
		return
	}
	k := rec.ToKey()
	err := db.Put(tx, "recent", k, rec)
	if err != nil {
		log.Print(err)
	}
}
func Append(rec *record.Head) {
	err := db.DB.Update(func(tx *bolt.Tx) error {
		appendHead(tx, rec)
		return nil
	})
	if err != nil {
		log.Println(err)
	}
}
func find(rec *record.Head) bool {
	k := rec.ToKey()
	var r int
	err := db.DB.View(func(tx *bolt.Tx) error {
		var err error
		r, err = db.Count(tx, "recent", k)
		return err
	})
	if err != nil {
		log.Print(err)
	}
	return r > 0
}
func RemoveOlds() {
	if cfg.RecentRange <= 0 {
		return
	}
	t := time.Now().Unix() - cfg.RecentRange
	err := db.DB.Update(func(tx *bolt.Tx) error {
		ba := tx.Bucket([]byte("recent"))
		if ba == nil {
			return errors.New("bucket is not found")
		}
		c := ba.Cursor()
		for k, v := c.First(); k != nil; k, v = c.Next() {
			var m record.Head
			if err := json.Unmarshal(v, &m); err != nil {
				return err
			}
			if m.Stamp > t {
				continue
			}
			if err := c.Delete(); err != nil {
				log.Println(err)
			}
		}
		return nil
	})
	if err != nil {
		log.Println(err)
	}
}