OpenSearch/rest-api-spec/test/percolate/16_existing_doc.yaml
javanna 9c847db8af Percolate api: support encoded body as query string param consistently
The percolate api doesn't parse the encoded body provided as `source` query string parameter, when percolating an existing document. Fixed and added REST test that would have caught this since we randomly use GET + encoded `source` param instead of GET + request body in our java runner (the perl runner does the same too).

Closes #9628
2015-02-11 08:53:04 +11:00

113 lines
2.0 KiB
YAML

---
"Percolate existing documents":
- do:
indices.create:
index: percolator_index
- do:
index:
index: percolator_index
type: .percolator
id: test_percolator
body:
query:
match_all: {}
tag: tag1
- do:
index:
index: percolator_index
type: test_type
id: 1
body:
foo: bar
- do:
indices.create:
index: my_index
- do:
index:
index: my_index
type: my_type
id: 1
body:
foo: bar
- do:
indices.refresh: {}
- do:
percolate:
index: percolator_index
type: test_type
id: 1
- match: {'matches': [{_index: percolator_index, _id: test_percolator}]}
- do:
percolate:
index: my_index
type: my_type
id: 1
percolate_index: percolator_index
percolate_type: test_type
- match: {'matches': [{_index: percolator_index, _id: test_percolator}]}
- do:
index:
index: my_index
type: my_type
id: 1
body:
foo: bar
- do:
percolate:
index: my_index
type: my_type
id: 1
version: 2
percolate_index: percolator_index
percolate_type: test_type
- match: {'matches': [{_index: percolator_index, _id: test_percolator}]}
- do:
catch: conflict
percolate:
index: my_index
type: my_type
id: 1
version: 1
percolate_index: percolator_index
percolate_type: test_type
- do:
percolate:
index: percolator_index
type: test_type
id: 1
body:
filter:
term:
tag: non_existing_tag
- match: {'matches': []}
- do:
percolate:
index: percolator_index
type: test_type
id: 1
body:
filter:
term:
tag: tag1
- match: {'matches': [{_index: percolator_index, _id: test_percolator}]}