Skip to content

Commit

Permalink
Do not consider disabled spaces during search
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed May 10, 2023
1 parent 8ffa596 commit 3b9603c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions services/search/pkg/search/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,17 @@ func (s *Service) Search(ctx context.Context, req *searchsvc.SearchRequest) (*se
return nil, err
}

mountpointMap := map[string]string{}
spaces := []*provider.StorageSpace{}
for _, space := range listSpacesRes.StorageSpaces {
if utils.ReadPlainFromOpaque(space.Opaque, "trashed") == "trashed" {
// Do not consider disabled spaces
continue
}
spaces = append(spaces, space)
}

mountpointMap := map[string]string{}
for _, space := range spaces {
if space.SpaceType != "mountpoint" {
continue
}
Expand All @@ -96,7 +105,7 @@ func (s *Service) Search(ctx context.Context, req *searchsvc.SearchRequest) (*se

matches := matchArray{}
total := int32(0)
for _, space := range listSpacesRes.StorageSpaces {
for _, space := range spaces {
searchRootID := &searchmsg.ResourceID{
StorageId: space.Root.StorageId,
SpaceId: space.Root.SpaceId,
Expand Down

0 comments on commit 3b9603c

Please sign in to comment.