Changed the `ignore_missing` client parameter to `ignore: 404`

This should make easier any potential expansion such as:

    client.update('index', 'type', 41, {...}, ignore: 409

Also restructured and renamed the test suite a bit as part of the commit.

---

This reverts commit 0b142cc8812d8d090e48ea0ad89c007767870b91, "Removed client-specific `ignore_missing` parameter".
This commit is contained in:
Karel Minarik 2013-09-09 22:27:35 +02:00
parent 6cfbd2f7c4
commit 397235e2f2
9 changed files with 113 additions and 43 deletions

View File

@ -1,13 +1,6 @@
---
"Basic":
- do:
catch: missing
delete:
index: test_1
type: test
id: 1
- do:
index:
index: test_1
@ -16,7 +9,7 @@
body: { foo: bar }
- is_true: ok
- match: { _version: 2 }
- match: { _version: 1 }
- do:
delete:
@ -24,4 +17,4 @@
type: test
id: 1
- match: { _version: 3 }
- match: { _version: 2 }

View File

@ -0,0 +1,19 @@
---
"Missing document with catch":
- do:
catch: missing
delete:
index: test_1
type: test
id: 1
---
"Missing document with ignore":
- do:
delete:
index: test_1
type: test
id: 1
ignore: 404

View File

@ -1,12 +1,5 @@
---
"Basic GET":
- do:
catch: missing
get:
index: test_1
type: test
id: 1
"Basic":
- do:
index:

View File

@ -0,0 +1,19 @@
---
"Missing document with catch":
- do:
catch: missing
get:
index: test_1
type: test
id: 1
---
"Missing document with ignore":
- do:
get:
index: test_1
type: test
id: 1
ignore: 404

View File

@ -4,12 +4,6 @@
- skip:
version: "0 - 0.90.0"
reason: "Get source not supported in pre 0.90.1 versions."
- do:
catch: missing
get_source:
index: test_1
type: test
id: 1
- do:
index:

View File

@ -0,0 +1,28 @@
---
"Missing document with catch":
- skip:
version: "0 - 0.90.0"
reason: "Get source not supported in pre 0.90.1 versions."
- do:
catch: missing
get_source:
index: test_1
type: test
id: 1
---
"Missing document with ignore":
- skip:
version: "0 - 0.90.0"
reason: "Get source not supported in pre 0.90.1 versions."
- do:
get_source:
index: test_1
type: test
id: 1
ignore: 404

View File

@ -1,13 +1,5 @@
---
"Doc":
- do:
catch: missing
update:
index: test_1
type: test
id: 1
body: {doc: { foo: bar }}
"Partial document":
- do:
index:
@ -17,7 +9,7 @@
body:
foo: bar
count: 1
nested: { one: 1, two: 2}
nested: { one: 1, two: 2 }
- do:
update:

View File

@ -1,16 +1,6 @@
---
"Script":
- do:
catch: missing
update:
index: test_1
type: test
id: 1
body:
script: "ctx._source.foo = bar"
params: { bar: 'xxx' }
- do:
index:
index: test_1

View File

@ -0,0 +1,42 @@
---
"Missing document (partial doc)":
- do:
catch: missing
update:
index: test_1
type: test
id: 1
body: { doc: { foo: bar } }
- do:
update:
index: test_1
type: test
id: 1
body: { doc: { foo: bar } }
ignore: 404
---
"Missing document (script)":
- do:
catch: missing
update:
index: test_1
type: test
id: 1
body:
script: "ctx._source.foo = bar"
params: { bar: 'xxx' }
- do:
update:
index: test_1
type: test
id: 1
ignore: 404
body:
script: "ctx._source.foo = bar"
params: { bar: 'xxx' }