👔 Update search post include range
This commit is contained in:
parent
9bb55f10ce
commit
89b495577e
@ -99,7 +99,10 @@ func FilterPostDraft(tx *gorm.DB) *gorm.DB {
|
||||
|
||||
func FilterPostWithFuzzySearch(tx *gorm.DB, probe string) *gorm.DB {
|
||||
probe = "%" + probe + "%"
|
||||
return tx.Where("? AND body->>'content' ILIKE ?", gorm.Expr("body ? 'content'"), probe)
|
||||
return tx.
|
||||
Where("? AND body->>'content' ILIKE ?", gorm.Expr("body ? 'content'"), probe).
|
||||
Or("? AND body->>'title' ILIKE ?", gorm.Expr("body ? 'title'"), probe).
|
||||
Or("? AND body->>'description' ILIKE ?", gorm.Expr("body ? 'description'"), probe)
|
||||
}
|
||||
|
||||
func PreloadGeneral(tx *gorm.DB) *gorm.DB {
|
||||
|
Loading…
Reference in New Issue
Block a user