From 0109e7889137b2b8353255181c9181996588d3e7 Mon Sep 17 00:00:00 2001 From: Honza Kral Date: Thu, 18 Jul 2013 16:23:22 +0200 Subject: [PATCH] Added test for searching over type and all indices --- .../test/search/20_type_no_index.yaml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) create mode 100644 rest-api-spec/test/search/20_type_no_index.yaml diff --git a/rest-api-spec/test/search/20_type_no_index.yaml b/rest-api-spec/test/search/20_type_no_index.yaml new file mode 100644 index 00000000000..9977de956da --- /dev/null +++ b/rest-api-spec/test/search/20_type_no_index.yaml @@ -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" }