Skip to content

Commit d3d6925

Browse files
committed
bugfix: fix searchByTerm with meilisearch .
Signed-off-by: adam.wu <[email protected]>
1 parent 2210cbb commit d3d6925

File tree

1 file changed

+2
-2
lines changed
  • pkg/infra/search/storage/meilisearch

1 file changed

+2
-2
lines changed

pkg/infra/search/storage/meilisearch/parse.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ func buildEqualClause(key string, value any) (string, error) {
180180
if err != nil {
181181
return "", fmt.Errorf("key %s: %v", key, err)
182182
}
183-
return fmt.Sprintf("%s = '%s'", key, valueStr), nil
183+
return fmt.Sprintf("%s = %s", key, valueStr), nil
184184
}
185185

186186
// 构建 IN 条件
@@ -200,7 +200,7 @@ func buildInClause(key string, values []any) (string, error) {
200200
func convertValue(value any) (string, error) {
201201
switch v := value.(type) {
202202
case string:
203-
return "'" + strings.ReplaceAll(v, "'", "\\'") + "'", nil
203+
return "'" + v + "'", nil
204204
case int, int32, int64, float32, float64:
205205
return fmt.Sprintf("%v", v), nil
206206
case bool:

0 commit comments

Comments
 (0)