OpenSearch/rest-api-spec/test/indices.get_warmer/10_basic.yaml

213 lines
4.3 KiB
YAML

---
setup:
- do:
indices.create:
index: test_1
- do:
indices.create:
index: test_2
- do:
cluster.health:
wait_for_status: yellow
- do:
indices.put_warmer:
index: test_1
name: warmer_1
body: { query: { match_all: { }}}
- do:
indices.put_warmer:
index: test_1
name: warmer_2
body: { query: { match_all: { }}}
- do:
indices.put_warmer:
index: test_2
name: warmer_2
body: { query: { match_all: { }}}
- do:
indices.put_warmer:
index: test_2
name: warmer_3
body: { query: { match_all: { }}}
- do:
indices.refresh: {}
---
"Get /_warmer":
- do:
indices.get_warmer: {}
- match: { test_1.warmers.warmer_1.source.query.match_all: {}}
- match: { test_1.warmers.warmer_2.source.query.match_all: {}}
- match: { test_2.warmers.warmer_2.source.query.match_all: {}}
- match: { test_2.warmers.warmer_3.source.query.match_all: {}}
---
"Get /{index}/_warmer":
- do:
indices.get_warmer:
index: test_1
- match: { test_1.warmers.warmer_1.source.query.match_all: {}}
- match: { test_1.warmers.warmer_2.source.query.match_all: {}}
- is_false: test_2
---
"Get /{index}/_warmer/_all":
- do:
indices.get_warmer:
index: test_1
name: _all
- match: { test_1.warmers.warmer_1.source.query.match_all: {}}
- match: { test_1.warmers.warmer_2.source.query.match_all: {}}
- is_false: test_2
---
"Get /{index}/_warmer/*":
- do:
indices.get_warmer:
index: test_1
name: '*'
- match: { test_1.warmers.warmer_1.source.query.match_all: {}}
- match: { test_1.warmers.warmer_2.source.query.match_all: {}}
- is_false: test_2
---
"Get /{index}/_warmer/{name}":
- do:
indices.get_warmer:
index: test_1
name: warmer_1
- match: { test_1.warmers.warmer_1.source.query.match_all: {}}
- is_false: test_1.warmers.warmer_2
- is_false: test_2
---
"Get /{index}/_warmer/{name,name}":
- do:
indices.get_warmer:
index: test_1
name: warmer_1,warmer_2
- match: { test_1.warmers.warmer_1.source.query.match_all: {}}
- match: { test_1.warmers.warmer_2.source.query.match_all: {}}
- is_false: test_2
---
"Get /{index}/_warmer/{name*}":
- do:
indices.get_warmer:
index: test_1
name: '*2'
- match: { test_1.warmers.warmer_2.source.query.match_all: {}}
- is_false: test_1.warmers.warmer_1
- is_false: test_2
---
"Get /_warmer/{name}":
- do:
indices.get_warmer:
name: warmer_2
- match: { test_1.warmers.warmer_2.source.query.match_all: {}}
- match: { test_2.warmers.warmer_2.source.query.match_all: {}}
- is_false: test_1.warmers.warmer_1
- is_false: test_2.warmers.warmer_3
---
"Get /_all/_warmer/{name}":
- do:
indices.get_warmer:
index: _all
name: warmer_2
- match: { test_1.warmers.warmer_2.source.query.match_all: {}}
- match: { test_2.warmers.warmer_2.source.query.match_all: {}}
- is_false: test_1.warmers.warmer_1
- is_false: test_2.warmers.warmer_3
---
"Get /*/_warmer/{name}":
- do:
indices.get_warmer:
index: '*'
name: warmer_2
- match: { test_1.warmers.warmer_2.source.query.match_all: {}}
- match: { test_2.warmers.warmer_2.source.query.match_all: {}}
- is_false: test_1.warmers.warmer_1
- is_false: test_2.warmers.warmer_3
---
"Get /index,index/_warmer/{name}":
- do:
indices.get_warmer:
index: test_1,test_2
name: warmer_2
- match: { test_1.warmers.warmer_2.source.query.match_all: {}}
- match: { test_2.warmers.warmer_2.source.query.match_all: {}}
- is_false: test_2.warmers.warmer_3
---
"Get /index*/_warmer/{name}":
- do:
indices.get_warmer:
index: '*2'
name: warmer_2
- match: { test_2.warmers.warmer_2.source.query.match_all: {}}
- is_false: test_1
- is_false: test_2.warmers.warmer_3
---
"Empty response when no matching warmer":
- do:
indices.get_warmer:
index: '*'
name: non_existent
- match: { '': {}}
---
"Throw 404 on missing index":
- do:
catch: missing
indices.get_warmer:
index: non_existent
name: '*'
---
"Get /_warmer with local flag":
- do:
indices.get_warmer:
local: true
- is_true: test_1
- is_true: test_2