Skip to content

Commit

Permalink
Merge f9eb2a9 into 5f12697
Browse files Browse the repository at this point in the history
  • Loading branch information
imlewc authored Sep 5, 2023
2 parents 5f12697 + f9eb2a9 commit fbbe956
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion storage/cache/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ func (r *Redis) SearchDocuments(ctx context.Context, collection, subset string,
builder.WriteString(fmt.Sprintf(" @subset:{ %s }", escape(subset)))
}
for _, q := range query {
builder.WriteString(fmt.Sprintf(" @categories:{ %s }", encdodeCategory(q)))
builder.WriteString(fmt.Sprintf(" @categories:{ %s }", escape(encdodeCategory(q))))
}
args := []any{"FT.SEARCH", r.DocumentTable(), builder.String(), "SORTBY", "score", "DESC", "LIMIT", begin}
if end == -1 {
Expand Down Expand Up @@ -560,6 +560,7 @@ func escape(s string) string {
":", "\\:",
".", "\\.",
"/", "\\/",
"+", "\\+",
)
return r.Replace(s)
}

0 comments on commit fbbe956

Please sign in to comment.