1
- [[embedded-json ]]
2
- === Embedded JSON datatype
1
+ [[flattened ]]
2
+ === Flattened datatype
3
3
4
4
By default, each subfield in an object is mapped and indexed separately. If
5
5
the names or types of the subfields are not known in advance, then they are
6
6
<<dynamic-mapping, mapped dynamically>>.
7
7
8
- The `embedded_json ` type provides an alternative approach, where the entire
9
- object is mapped as a single field. Given an object, the `embedded_json `
8
+ The `flattened ` type provides an alternative approach, where the entire
9
+ object is mapped as a single field. Given an object, the `flattened `
10
10
mapping will parse out its leaf values and index them into one field as
11
11
keywords. The object's contents can then be searched through simple queries
12
12
and aggregations.
@@ -16,17 +16,17 @@ number of unique keys. Only one field mapping is created for the whole JSON
16
16
object, which can help prevent a <<mapping-limit-settings, mappings explosion>>
17
17
from having too many distinct field mappings.
18
18
19
- On the other hand, embedded JSON fields present a trade-off in terms of search
20
- functionality. Only basic queries are allowed, with no support for numeric
21
- range queries or highlighting. Further information on the limitations can be
22
- found in the <<supported-operations, Supported operations>> section.
19
+ On the other hand, flattened object fields present a trade-off in terms of
20
+ search functionality. Only basic queries are allowed, with no support for
21
+ numeric range queries or highlighting. Further information on the limitations
22
+ can be found in the <<supported-operations, Supported operations>> section.
23
23
24
- NOTE: The `embedded_json ` mapping type should **not** be used for indexing all
25
- JSON content, as it treats all values as keywords and does not provide full
24
+ NOTE: The `flattened ` mapping type should **not** be used for indexing all
25
+ document content, as it treats all values as keywords and does not provide full
26
26
search functionality. The default approach, where each subfield has its own
27
27
entry in the mappings, works well in the majority of cases.
28
28
29
- An embedded JSON field can be created as follows:
29
+ An flattened object field can be created as follows:
30
30
[source,js]
31
31
--------------------------------
32
32
PUT bug_reports
@@ -37,7 +37,7 @@ PUT bug_reports
37
37
"type": "text"
38
38
},
39
39
"labels": {
40
- "type": "embedded_json "
40
+ "type": "flattened "
41
41
}
42
42
}
43
43
}
@@ -63,7 +63,7 @@ During indexing, tokens are created for each leaf value in the JSON object. The
63
63
values are indexed as string keywords, without analysis or special handling for
64
64
numbers or dates.
65
65
66
- Querying the top-level `embedded_json ` field searches all leaf values in the
66
+ Querying the top-level `flattened ` field searches all leaf values in the
67
67
object:
68
68
69
69
[source,js]
@@ -77,7 +77,7 @@ POST bug_reports/_search
77
77
--------------------------------
78
78
// CONSOLE
79
79
80
- To query on a specific key in the JSON object, object dot notation is used:
80
+ To query on a specific key in the flattened object, object dot notation is used:
81
81
[source,js]
82
82
--------------------------------
83
83
POST bug_reports/_search
@@ -92,11 +92,11 @@ POST bug_reports/_search
92
92
[[supported-operations]]
93
93
==== Supported operations
94
94
95
- Because of the similarities in the way values are indexed, `embedded_json `
95
+ Because of the similarities in the way values are indexed, `flattened `
96
96
fields share much of the same mapping and search functionality as
97
97
<<keyword, `keyword`>> fields.
98
98
99
- Currently, embedded JSON fields can be used with the following query types:
99
+ Currently, flattened object fields can be used with the following query types:
100
100
101
101
- `term`, `terms`, and `terms_set`
102
102
- `prefix`
@@ -108,19 +108,19 @@ Currently, embedded JSON fields can be used with the following query types:
108
108
When querying, it is not possible to refer to field keys using wildcards, as in
109
109
`{ "term": {"labels.time*": 1541457010}}`. Note that all queries, including
110
110
`range`, treat the values as string keywords. Highlighting is not supported on
111
- `embedded_json ` fields.
111
+ `flattened ` fields.
112
112
113
- It is possible to sort on an embedded JSON field, as well as perform simple
113
+ It is possible to sort on an flattened object field, as well as perform simple
114
114
keyword-style aggregations such as `terms`. As with queries, there is no
115
115
special support for numerics -- all values in the JSON object are treated as
116
116
keywords. When sorting, this implies that values are compared
117
117
lexicographically.
118
118
119
- Embedded JSON fields currently cannot be stored. It is not possible to specify
120
- the <<mapping-store, `store`>> parameter in the mapping.
119
+ Flattened object fields currently cannot be stored. It is not possible to
120
+ specify the <<mapping-store, `store`>> parameter in the mapping.
121
121
122
- [[json -params]]
123
- ==== Parameters for JSON fields
122
+ [[flattened -params]]
123
+ ==== Parameters for flattened object fields
124
124
125
125
The following mapping parameters are accepted:
126
126
@@ -133,9 +133,9 @@ The following mapping parameters are accepted:
133
133
134
134
`depth_limit`::
135
135
136
- The maximum allowed depth of the JSON field, in terms of nested inner
137
- objects. If a JSON field exceeds this limit, then an error will be
138
- thrown. Defaults to `20`.
136
+ The maximum allowed depth of the flattened object field, in terms of nested
137
+ inner objects. If a flattened object field exceeds this limit, then an
138
+ error will be thrown. Defaults to `20`.
139
139
140
140
<<doc-values,`doc_values`>>::
141
141
@@ -153,8 +153,8 @@ The following mapping parameters are accepted:
153
153
154
154
Leaf values longer than this limit will not be indexed. By default, there
155
155
is no limit and all values will be indexed. Note that this limit applies
156
- to the leaf values within the JSON field, and not the length of the entire
157
- field.
156
+ to the leaf values within the flattened object field, and not the length of
157
+ the entire field.
158
158
159
159
<<mapping-index,`index`>>::
160
160
@@ -170,8 +170,8 @@ The following mapping parameters are accepted:
170
170
<<null-value,`null_value`>>::
171
171
172
172
A string value which is substituted for any explicit `null` values within
173
- the JSON field. Defaults to `null`, which means null sfields are treated as
174
- if it were missing.
173
+ the flattened object field. Defaults to `null`, which means null sields are
174
+ treated as if it were missing.
175
175
176
176
<<similarity,`similarity`>>::
177
177
0 commit comments