diff --git a/gateways/algolia/algolia.go b/gateways/algolia/algolia.go index c4f1e20..c6c4fc2 100644 --- a/gateways/algolia/algolia.go +++ b/gateways/algolia/algolia.go @@ -67,13 +67,14 @@ func (a *algolia) IndexNodes(ctx context.Context, nodes ...*ent.Node) error { }, len(nodes)) for i, n := range nodes { - objects[i] = struct { + o := struct { ObjectID string `json:"objectID"` *ent.Node }{ ObjectID: n.ID, Node: n, } + objects[i] = o } res, err := index.SaveObjects(objects) @@ -118,13 +119,15 @@ func (a *algolia) IndexNodeVersions(ctx context.Context, nodes ...*ent.NodeVersi }, len(nodes)) for i, n := range nodes { - objects[i] = struct { + o := struct { ObjectID string `json:"objectID"` *ent.NodeVersion }{ ObjectID: n.ID.String(), NodeVersion: n, } + o.StatusReason = "" + objects[i] = o } res, err := index.SaveObjects(objects) diff --git a/services/registry/registry_svc.go b/services/registry/registry_svc.go index 520a6ec..d8e7e1c 100644 --- a/services/registry/registry_svc.go +++ b/services/registry/registry_svc.go @@ -876,10 +876,10 @@ func (s *RegistryService) ReindexAllNodes(ctx context.Context, client *ent.Clien return fmt.Errorf("failed to reindex all nodes: %w", err) } - log.Ctx(ctx).Info().Msgf("reindexing %d number of nodes version", len(nvs)) + log.Ctx(ctx).Info().Msgf("reindexing %d number of node versions", len(nvs)) err = s.algolia.IndexNodeVersions(ctx, nvs...) if err != nil { - return fmt.Errorf("failed to reindex all nodes: %w", err) + return fmt.Errorf("failed to reindex all node versions: %w", err) } return nil }