Example #1
0
// New returns a bare-bones searcher with no text to search. Once all options
// are set, the search can be executed with the Results method. Each result
// returned corresponds to precisely one entity in the database.
//
// (A bare-bones searcher can still have text to search with the Query method.)
func New(db *imdb.DB) *Searcher {
	return &Searcher{
		db:               db,
		fuzzy:            db.IsFuzzyEnabled(),
		limit:            30,
		goodThreshold:    0.25,
		similarThreshold: 0.4,
		what:             "entity",
	}
}