mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-06 21:18:31 +00:00
9c847db8af
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
113 lines
2.0 KiB
YAML
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}]}
|
|
|