Added test for searching over type and all indices

This commit is contained in:
Honza Kral 2013-07-18 16:23:22 +02:00
parent 5f4438f34c
commit 0109e78891
1 changed files with 42 additions and 0 deletions

View File

@ -0,0 +1,42 @@
---
"Default index/type":
- do:
indices.create:
index: test_2
- do:
indices.create:
index: test_1
- do:
index:
index: test_1
type: test
id: 1
body: { foo: bar }
- do:
index:
index: test_2
type: test
id: 42
body: { foo: bar }
- do:
indices.refresh:
index: [test_1, test_2]
- do:
search:
type: test
body:
query:
match:
foo: bar
- match: {hits.total: 2}
- match: {hits.hits.0._index: test_1 }
- match: {hits.hits.0._type: test }
- match: {hits.hits.0._id: "1" }
- match: {hits.hits.1._index: test_2 }
- match: {hits.hits.1._type: test }
- match: {hits.hits.1._id: "42" }