-
Notifications
You must be signed in to change notification settings - Fork 28
/
HasParentTest.kt
60 lines (53 loc) · 1.44 KB
/
HasParentTest.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
54
55
56
57
58
59
60
/*
* Copyright (c) 2016. Michael Buhot m.buhot@gmail.com
*/
package mbuhot.eskotlin.query.joining
import mbuhot.eskotlin.query.should_render_as
import mbuhot.eskotlin.query.term.term
import org.elasticsearch.index.query.InnerHitBuilder
import org.junit.Test
/**
* Created on 3/03/2016
* @author Michael Buhot (m.buhot@gmail.com)
*/
class HasParentTest {
@Test
fun `test has_parent`() {
val query = has_parent {
parent_type = "blog"
query {
term {
"tag" to "something"
}
}
inner_hits = InnerHitBuilder()
}
query should_render_as """
{
"has_parent": {
"query": {
"term": {
"tag": {
"value": "something",
"boost": 1.0
}
}
},
"parent_type": "blog",
"score": false,
"ignore_unmapped": false,
"boost": 1.0,
"inner_hits": {
"ignore_unmapped": false,
"from": 0,
"size": 3,
"version": false,
"seq_no_primary_term": false,
"explain": false,
"track_scores": false
}
}
}
"""
}
}