Skip to content

Commit

Permalink
Indexed Templates : Add another rest test
Browse files Browse the repository at this point in the history
This rest test indexes a template then uses it in search.

See elastic#5637
  • Loading branch information
GaelTadh committed Jul 14, 2014
1 parent 6682fd7 commit 029b738
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions rest-api-spec/test/template/20_search.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
"Indexed Template query tests":

- do:
index:
index: test
type: testtype
id: 1
body: { "text": "value1_foo" }
- do:
index:
index: test
type: testtype
id: 2
body: { "text": "value2_foo value3_foo" }
- do:
indices.refresh: {}

- do:
indexed_template.create:
id: "1"
body: { "template": { "query": { "match" : { "text": "{{my_value}}" } }, "size": "{{my_size}}" } }
- match: { _id: "1" }

- do:
indices.refresh: {}


- do:
search_template:
body: { "template": { "id" : "1" }, "params" : { "my_value" : "value1_foo", "my_size" : 1 } }
- match: { hits.total: 1 }

- do:
search_template:
body: { "id" : "1", "params" : { "my_value" : "value1_foo", "my_size" : 1 } }
- match: { hits.total: 1 }

0 comments on commit 029b738

Please sign in to comment.