feat: keep the materials index in sync and add bm:materials-reindex
- the materials admin syncs after create and update and removes after delete, once the save transaction commits (UseMaterialIndex, set at Boot) - POST and PUT /api/v1/bm/materials sync after the transaction, DELETE removes the document (its statement has no primary key, so no callback) - bm:materials-reindex [--fresh] [--if-configured] ensures the index and syncs every material; it refuses without an engine and runs nightly at 04:15 with --if-configured - TestMaterialSearchAgainstDatabase (Postgres) is written for the final verification phase
This commit is contained in:
@@ -130,6 +130,13 @@ func (s *Stub) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
}
|
||||
|
||||
// SetHits replaces the answer of every later search.
|
||||
func (s *Stub) SetHits(hits ...Hit) {
|
||||
s.mu.Lock()
|
||||
defer s.mu.Unlock()
|
||||
s.Hits = hits
|
||||
}
|
||||
|
||||
// Requests returns the requests received so far.
|
||||
func (s *Stub) Requests() []Request {
|
||||
s.mu.Lock()
|
||||
|
||||
Reference in New Issue
Block a user