diff --git a/services/search/pkg/query/kql/normalize.go b/services/search/pkg/query/kql/normalize.go index 69443819411..7b7dfd3f8f7 100644 --- a/services/search/pkg/query/kql/normalize.go +++ b/services/search/pkg/query/kql/normalize.go @@ -13,7 +13,7 @@ var operatorNodeOr = ast.OperatorNode{Base: &ast.Base{Loc: &ast.Location{Source: // https://learn.microsoft.com/en-us/sharepoint/dev/general-development/keyword-query-language-kql-syntax-reference#constructing-free-text-queries-using-kql // If there are multiple free-text expressions without any operators in between them, the query behavior is the same as using the AND operator. // "John Smith" "Jane Smith" -// This functionally is the same as using the OR Boolean operator, as follows: +// This functionally is the same as using the AND Boolean operator, as follows: // "John Smith" AND "Jane Smith" // // https://learn.microsoft.com/en-us/sharepoint/dev/general-development/keyword-query-language-kql-syntax-reference#using-multiple-property-restrictions-within-a-kql-query diff --git a/services/search/pkg/query/kql/normalize_test.go b/services/search/pkg/query/kql/normalize_test.go index f93da28eed8..ef2f2e4b099 100644 --- a/services/search/pkg/query/kql/normalize_test.go +++ b/services/search/pkg/query/kql/normalize_test.go @@ -37,6 +37,18 @@ func TestNormalizeNodes(t *testing.T) { &ast.StringNode{Key: "author", Value: "Jane Smith"}, }, }, + { + name: "no key explicit AND", + givenNodes: []ast.Node{ + &ast.StringNode{Value: "John Smith"}, + &ast.StringNode{Value: "Jane Smith"}, + }, + expectedNodes: []ast.Node{ + &ast.StringNode{Value: "John Smith"}, + &ast.OperatorNode{Value: "AND"}, + &ast.StringNode{Value: "Jane Smith"}, + }, + }, { name: "same key explicit AND", givenNodes: []ast.Node{