mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-07 12:50:21 -06:00
fix: acceptance tests to include path resource
This commit is contained in:
@@ -177,10 +177,10 @@ func (b *Bleve) Search(_ context.Context, sir *searchService.SearchIndexRequest)
|
||||
|
||||
if sir.Ref != nil {
|
||||
hitPath := strings.TrimSuffix(getFieldValue[string](hit.Fields, "Path"), "/")
|
||||
sirPath := utils.MakeRelativePath(sir.Ref.Path)
|
||||
isMountPoint := hitPath == sirPath
|
||||
requestedPath := utils.MakeRelativePath(sir.Ref.Path)
|
||||
isPathRoot := hitPath == requestedPath
|
||||
|
||||
if !isMountPoint && sirPath != "." && !strings.HasPrefix(hitPath, sirPath+"/") {
|
||||
if !isPathRoot && requestedPath != "." && !strings.HasPrefix(hitPath, requestedPath+"/") {
|
||||
totalMatches--
|
||||
continue
|
||||
}
|
||||
|
||||
@@ -341,7 +341,7 @@ var _ = Describe("Bleve", func() {
|
||||
It("search *doc* in a subfolder", func() {
|
||||
res, err := doSearch(rootResource.ID, "Name:*doc*", "./doc")
|
||||
Expect(err).ToNot(HaveOccurred())
|
||||
Expect(res.TotalMatches).To(Equal(int32(1)))
|
||||
Expect(res.TotalMatches).To(Equal(int32(2)))
|
||||
})
|
||||
It("search *file* in a root", func() {
|
||||
res, err := doSearch(rootResource.ID, "Name:*file*", "")
|
||||
|
||||
Reference in New Issue
Block a user