func (s *Search) Init(storage *Storage, tfss []*TagFilters, tr TimeRange, maxMetrics int) {
	if s.needClosing {
		logger.Panicf("BUG: missing MustClose call before the next call to Init")
	}

	s.reset()
	s.needClosing = true

	tsids, err := storage.searchTSIDs(tfss, tr, maxMetrics)

	// It is ok to call Init on error from storage.searchTSIDs.
	// Init must be called before returning because it will fail
	// on Seach.MustClose otherwise.
	s.ts.Init(storage.tb, tsids, tr)

	if err != nil {
		s.err = err
		return
	}

	s.storage = storage
}
// Init initializes s from the given storage, tfss and tr.
//
// MustClose must be called when the search is done.
Init initializes s from the given storage, tfss and tr.

MustClose must be called when the search is done.
// Init initializes s from the given storage tfss and tr . // // MustClose must be called when the search is done .
func (s *Search) Init(storage *Storage, tfss []*TagFilters, tr TimeRange, maxMetrics int) {
	if s.needClosing {
		logger.Panicf("BUG: missing MustClose call before the next call to Init")
	}
	s.reset()
	s.needClosing = true
	tsids, err := storage.searchTSIDs(tfss, tr, maxMetrics)
	s.ts.Init(storage.tb, tsids, tr)
	if err != nil {
		s.err = err
		return
	}
	s.storage = storage
}
func ( s * Search ) Init ( storage * Storage , tfss [ ] * TagFilters , tr TimeRange , maxMetrics int ) { if s . needClosing { logger . Panicf ( " " ) } s . reset ( ) s . needClosing = true tsids , err := storage . searchTSIDs ( tfss , tr , maxMetrics ) s . ts . Init ( storage . tb , tsids , tr ) if err != nil { s . err = err return } s . storage = storage }
Init initializes s from the given storage, tfss and tr.
Init initializes s from the given storage tfss and tr .
// It is ok to call Init on error from storage.searchTSIDs. // Init must be called before returning because it will fail // on Seach.MustClose otherwise.