summaryrefslogtreecommitdiff
path: root/docs/reference/mapping
diff options
context:
space:
mode:
authorDaniel Mitterdorfer <daniel.mitterdorfer@gmail.com>2017-01-19 07:59:18 +0100
committerGitHub <noreply@github.com>2017-01-19 07:59:18 +0100
commitaece89d6a1168fb15bccf53fa4c750c73a4b21c5 (patch)
tree3299dd555ce0c3cbe6ba07f78f6f559fcc0c9a81 /docs/reference/mapping
parentee5f8c452264d47181600d00427b32d08b0d60e2 (diff)
Make boolean conversion strict (#22200)
This PR removes all leniency in the conversion of Strings to booleans: "true" is converted to the boolean value `true`, "false" is converted to the boolean value `false`. Everything else raises an error.
Diffstat (limited to 'docs/reference/mapping')
-rw-r--r--docs/reference/mapping/types/boolean.asciidoc10
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/reference/mapping/types/boolean.asciidoc b/docs/reference/mapping/types/boolean.asciidoc
index d273dddb27..5f52192265 100644
--- a/docs/reference/mapping/types/boolean.asciidoc
+++ b/docs/reference/mapping/types/boolean.asciidoc
@@ -2,16 +2,16 @@
=== Boolean datatype
Boolean fields accept JSON `true` and `false` values, but can also accept
-strings and numbers which are interpreted as either true or false:
+strings which are interpreted as either true or false:
[horizontal]
False values::
- `false`, `"false"`, `"off"`, `"no"`, `"0"`, `""` (empty string), `0`, `0.0`
+ `false`, `"false"`
True values::
- Anything that isn't false.
+ `true`, `"true"`
For example:
@@ -32,7 +32,7 @@ PUT my_index
POST my_index/my_type/1
{
- "is_published": 1 <1>
+ "is_published": "true" <1>
}
GET my_index/_search
@@ -45,7 +45,7 @@ GET my_index/_search
}
--------------------------------------------------
// CONSOLE
-<1> Indexing a document with `1`, which is interpreted as `true`.
+<1> Indexing a document with `"true"`, which is interpreted as `true`.
<2> Searching for documents with a JSON `true`.
Aggregations like the <<search-aggregations-bucket-terms-aggregation,`terms`