diff --git a/services/search/pkg/search/search.go b/services/search/pkg/search/search.go index 47ded9a9f0..7ab61ea88d 100644 --- a/services/search/pkg/search/search.go +++ b/services/search/pkg/search/search.go @@ -226,7 +226,9 @@ func convertToWebDAVPermissions(isShared, isMountpoint, isDir bool, p *provider. } // CompleteRootID completes a bare driveId ("storage$space") to the root -// resource id stored in the index; a root's opaque id is its space id. +// resource id stored in the index. Assumes a space root's opaque id equals +// its space id (true for decomposedfs); elsewhere a bare driveId matches +// nothing, the pinning stays safe either way. func CompleteRootID(v string) string { // leave wildcards alone, "1$*!*" would match nothing if strings.Contains(v, "!") || strings.ContainsAny(v, "*?") { diff --git a/services/search/pkg/search/service_test.go b/services/search/pkg/search/service_test.go index 4af3d014a3..a5bce09181 100644 --- a/services/search/pkg/search/service_test.go +++ b/services/search/pkg/search/service_test.go @@ -509,6 +509,16 @@ var _ = Describe("Searchprovider", func() { indexClient.AssertNumberOfCalls(GinkgoT(), "Search", 1) }) + It("keeps the full fan-out for an OR query", func() { + res, err := s.Search(ctx, &searchsvc.SearchRequest{ + Query: `driveId:"storageid$personalspace" OR foo`, + }) + Expect(err).ToNot(HaveOccurred()) + Expect(res).ToNot(BeNil()) + Expect(len(res.Matches)).To(Equal(3)) + indexClient.AssertNumberOfCalls(GinkgoT(), "Search", 2) + }) + It("considers the search Ref parameter", func() { res, err := s.Search(ctx, &searchsvc.SearchRequest{ Query: "foo",