Search: Avoid panic with missing title (#103257)

This commit is contained in:
Ryan McKinley
2025-04-02 15:43:08 +03:00
committed by GitHub
parent 3c8d6b4119
commit c54496a3f9
2 changed files with 23 additions and 9 deletions
+10 -1
View File
@@ -538,7 +538,16 @@ func (b *bleveIndex) Search(
if err != nil {
return nil, err
}
searchrequest.Fields = f
if len(f) > 0 {
searchrequest.Fields = f
} else {
searchrequest.Fields = []string{
resource.SEARCH_FIELD_TITLE,
resource.SEARCH_FIELD_FOLDER,
resource.SEARCH_FIELD_SOURCE_PATH,
resource.SEARCH_FIELD_MANAGED_BY,
}
}
}
res, err := index.SearchInContext(ctx, searchrequest)