-
Notifications
You must be signed in to change notification settings - Fork 28
/
DisMaxTest.kt
53 lines (47 loc) · 1.18 KB
/
DisMaxTest.kt
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
* Copyright (c) 2016. Michael Buhot m.buhot@gmail.com
*/
package mbuhot.eskotlin.query.compound
import mbuhot.eskotlin.query.should_render_as
import mbuhot.eskotlin.query.term.term
import org.junit.Test
/**
* Created on 3/03/2016
* @author Michael Buhot (m.buhot@gmail.com)
*/
class DisMaxTest {
@Test
fun `test dis_max`() {
val query = dis_max {
tie_breaker = 0.7f
boost = 1.2f
queries = listOf(
term { "age" to "34" },
term { "age" to "35" }
)
}
query should_render_as """
{
"dis_max": {
"tie_breaker": 0.7,
"queries": [{
"term": {
"age": {
"value": "34",
"boost": 1.0
}
}
}, {
"term": {
"age": {
"value": "35",
"boost": 1.0
}
}
}],
"boost": 1.2
}
}
"""
}
}