Skip to content

Commit

Permalink
remove remaining invalid regex modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
morphy2k committed Mar 25, 2023
1 parent 8b48da4 commit 376d79f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion model/item/item.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func GetByText(q string, opts *Options, kind Kind) (*model.Result, error) {
{Key: "_kind", Value: kind},
{Key: "$and", Value: bson.A{
bson.M{"$text": bson.M{"$search": q}},
bson.M{"description": primitive.Regex{Pattern: fmt.Sprintf("(%s)", re), Options: "gim"}},
bson.M{"description": primitive.Regex{Pattern: fmt.Sprintf("(%s)", re), Options: "im"}},
}},
}
}
Expand Down
2 changes: 1 addition & 1 deletion model/location/featuregroup/group.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func GetByText(q, loc string, opts *Options) (*model.Result, error) {
{Key: "_location", Value: lID},
{Key: "$and", Value: bson.A{
bson.M{"$text": bson.M{"$search": q}},
bson.M{"description": primitive.Regex{Pattern: fmt.Sprintf("(%s)", re), Options: "gim"}},
bson.M{"description": primitive.Regex{Pattern: fmt.Sprintf("(%s)", re), Options: "im"}},
}},
}
}
Expand Down
2 changes: 1 addition & 1 deletion model/location/location.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ func GetByText(q string, opts *Options) (*model.Result, error) {
filter = bson.D{
{Key: "$and", Value: bson.A{
bson.M{"$text": bson.M{"$search": q}},
bson.M{"description": primitive.Regex{Pattern: fmt.Sprintf("(%s)", re), Options: "gim"}},
bson.M{"description": primitive.Regex{Pattern: fmt.Sprintf("(%s)", re), Options: "im"}},
}},
}
}
Expand Down

0 comments on commit 376d79f

Please sign in to comment.