-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathquery_dis_max_test.go
More file actions
39 lines (36 loc) · 894 Bytes
/
query_dis_max_test.go
File metadata and controls
39 lines (36 loc) · 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Modified by DefenseStation on 2024-06-06
// Changes: Updated ElasticSearch client to OpenSearch client, changed package name to 'osquery',
// updated references to OpenSearch documentation, and modified examples accordingly.
package osquery
import (
"testing"
)
func TestDisMax(t *testing.T) {
runMapTests(t, []mapTest{
{
"dis_max",
DisMax(Term("title", "Quick pets"), Term("body", "Quick pets")).TieBreaker(0.7),
map[string]interface{}{
"dis_max": map[string]interface{}{
"queries": []map[string]interface{}{
{
"term": map[string]interface{}{
"title": map[string]interface{}{
"value": "Quick pets",
},
},
},
{
"term": map[string]interface{}{
"body": map[string]interface{}{
"value": "Quick pets",
},
},
},
},
"tie_breaker": 0.7,
},
},
},
})
}