feat: optimize database search (#2687)
* feat: remove index on `SearchNode.Name` As we do not use s% on name column, index there does not work * fix: init index after init data Or on the first run, it will log 'init index error: readObjectStart: expect { or n, but found , error found in #0 byte of ...||..., bigger context ...||...' * fix: match parent more precisely It will match `/a/bc` if we search in `/a/b` originally. But it is not backward compatible by adding a suffix `/` to all the data in parent field
This commit is contained in:
@ -20,7 +20,7 @@ type SearchReq struct {
|
||||
|
||||
type SearchNode struct {
|
||||
Parent string `json:"parent" gorm:"index"`
|
||||
Name string `json:"name" gorm:"index"`
|
||||
Name string `json:"name"`
|
||||
IsDir bool `json:"is_dir"`
|
||||
Size int64 `json:"size"`
|
||||
}
|
||||
|
Reference in New Issue
Block a user