You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/elasticsearch/mapping-reference/text.md
+54-1Lines changed: 54 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,8 +112,61 @@ These modifications can impact usage of `text` fields:
112
112
* Reordering text fields can have an effect on [phrase](/reference/query-languages/query-dsl/query-dsl-match-query-phrase.md) and [span](/reference/query-languages/query-dsl/span-queries.md) queries. See the discussion about [`position_increment_gap`](/reference/elasticsearch/mapping-reference/position-increment-gap.md) for more details. You can avoid this by making sure the `slop` parameter on the phrase queries is lower than the `position_increment_gap`. This is the default.
113
113
* Handling of `null` values is different. `text` fields ignore `null` values, but `keyword` fields support replacing `null` values with a value specified in the `null_value` parameter. This replacement is represented in synthetic source.
114
114
115
+
For example:
115
116
116
-
If the `text` field sets `store` to `true` then the sub-field is not used and no modifications are applied.
117
+
$$$synthetic-source-text-example-multi-field$$$
118
+
119
+
```console
120
+
PUT idx
121
+
{
122
+
"settings": {
123
+
"index": {
124
+
"mapping": {
125
+
"source": {
126
+
"mode": "synthetic"
127
+
}
128
+
}
129
+
}
130
+
},
131
+
"mappings": {
132
+
"properties": {
133
+
"text": {
134
+
"type": "text",
135
+
"fields": {
136
+
"kwd": {
137
+
"type": "keyword",
138
+
"null_value": "NA"
139
+
}
140
+
}
141
+
}
142
+
}
143
+
}
144
+
}
145
+
PUT idx/_doc/1
146
+
{
147
+
"text": [
148
+
null,
149
+
"the quick brown fox",
150
+
"the quick brown fox",
151
+
"jumped over the lazy dog",
152
+
]
153
+
}
154
+
```
155
+
156
+
Will become:
157
+
158
+
```console-result
159
+
{
160
+
"text": [
161
+
"jumped over the lazy dog"
162
+
"NA",
163
+
"the quick brown fox"
164
+
]
165
+
}
166
+
```
167
+
168
+
169
+
If the `text` field sets `store` to `true` then the sub-field is not used and no modifications are applied. For example:
0 commit comments