fix(fts): full-text search should not retrieve files in trash bin (fix #3386)

pull/3461/head
Aaron Liu 2 months ago
parent 9792a5c84f
commit a9a0c1ee78

@ -126,6 +126,10 @@ func (f *File) SizeUsed() int64 {
})
}
func (f *File) InTrashBin() bool {
return f.Root().Name() != inventory.RootFolderName
}
func (f *File) UpdatedAt() time.Time {
return f.Model.UpdatedAt
}

@ -160,6 +160,7 @@ type (
Entities() []Entity
PrimaryEntity() Entity
PrimaryEntityID() int
InTrashBin() bool
Shared() bool
IsSymbolic() bool
PolicyID() (id int)

@ -60,6 +60,10 @@ func (m *manager) SearchFullText(ctx context.Context, query string, offset int)
return FullTextSearchResult{}, false
}
if file.InTrashBin() {
return FullTextSearchResult{}, false
}
return FullTextSearchResult{
File: file,
Content: result.Text,

Loading…
Cancel
Save