Skip to content

revert(4.5.x): "fix: db.Find: look for phrases (escape the $text elements)" #1038

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright 2023 Northern.tech AS
Copyright 2024 Northern.tech AS

All content in this project is licensed under the Apache License v2, unless
indicated otherwise.
Expand Down
2 changes: 1 addition & 1 deletion LIC_FILES_CHKSUM.sha256
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#
# Apache-2.0
52b2497ce07650b825015e80ca7a5d40c360c04c530234ca6d950b0f98bca23a LICENSE
d0f406b04e7901e6b4076bdf5fd20f9d7f04fc41681069fd8954413ac6295688 LICENSE
cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 vendor/github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream/LICENSE.txt
cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 vendor/github.com/aws/aws-sdk-go-v2/config/LICENSE.txt
cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 vendor/github.com/aws/aws-sdk-go-v2/credentials/LICENSE.txt
Expand Down
2 changes: 1 addition & 1 deletion store/mongo/datastore_mongo.go
Original file line number Diff line number Diff line change
Expand Up @@ -2408,7 +2408,7 @@ func (db *DataStoreMongo) Find(ctx context.Context,

tq := bson.M{
"$text": bson.M{
"$search": "\"" + match.SearchText + "\"",
"$search": match.SearchText,
},
}

Expand Down
5 changes: 4 additions & 1 deletion store/mongo/deployments_external_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1286,11 +1286,14 @@ func TestDeploymentStorageFindBy(t *testing.T) {
},
{
InputModelQuery: model.Query{
SearchText: "NYC Production Inc.",
SearchText: "NYC foo",
},
InputDeploymentsCollection: someDeployments,
OutputError: nil,
OutputID: []string{
"a108ae14-bb4e-455f-9b40-000000000005",
"a108ae14-bb4e-455f-9b40-000000000004",
"a108ae14-bb4e-455f-9b40-000000000003",
"a108ae14-bb4e-455f-9b40-000000000002",
"a108ae14-bb4e-455f-9b40-000000000001",
},
Expand Down