Compare commits

..

No commits in common. "6e96c847ec03b727668a1e32e3e893a63d677181" and "535b8f1a6f94be4c1057e032cf8e66e097544b56" have entirely different histories.

View File

@ -369,27 +369,7 @@ func (r *RecipeRepository) SearchRecipes(filters domain.SearchFilters, userId *i
// Create search vector query // Create search vector query
var orderBy string = "" var orderBy string = ""
if filters.Search != "" { if filters.Search != "" {
spl := strings.Split(filters.Search, " ") vector_query := strings.ReplaceAll(filters.Search, " ", " | ")
var cleaned []string
// Use a string replacer, each word in the query will be passed through this
replacer := strings.NewReplacer(
"'", "",
"-", "",
"&", "",
"|", "",
"!", "",
)
for i := range len(spl) {
q := strings.TrimSpace(replacer.Replace(spl[i]))
if q != "" {
cleaned = append(cleaned, q)
}
}
vector_query := strings.Join(cleaned, " | ")
conditions = append( conditions = append(
conditions, conditions,