Commit a4488ed
committed
New timestamp default option changed the default behavior for missing paths
PR elastic#7036 changed the behavior for timestamp when provided as a parameter or within the document using `path` attribute.
This PR now considers that:
* when using timestamp as a parameter, we use a default value of `now`. Which means that if no timestamp is provided, the current time is used when the index operation is performed.
* when getting the timestamp from `path`, we use a default value of `null`. Which means that if no value is provided within the document, indexation will fail.
If users want to set the default value for `timestamp`, they can explicitly set one or set `"default": "now"`.
Closes elastic#8882.1 parent 6d87284 commit a4488ed
File tree
3 files changed
+74
-15
lines changed- docs/reference/mapping/fields
- src
- main/java/org/elasticsearch/index/mapper/internal
- test/java/org/elasticsearch/index/mapper/timestamp
3 files changed
+74
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
| 94 | + | |
93 | 95 | | |
94 | | - | |
| 96 | + | |
95 | 97 | | |
96 | 98 | | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
100 | 102 | | |
101 | 103 | | |
102 | | - | |
| 104 | + | |
| 105 | + | |
103 | 106 | | |
104 | 107 | | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
108 | | - | |
109 | | - | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| |||
Lines changed: 17 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
| 78 | + | |
78 | 79 | | |
79 | 80 | | |
80 | 81 | | |
| |||
129 | 130 | | |
130 | 131 | | |
131 | 132 | | |
| 133 | + | |
| 134 | + | |
132 | 135 | | |
133 | 136 | | |
134 | 137 | | |
| |||
141 | 144 | | |
142 | 145 | | |
143 | 146 | | |
| 147 | + | |
144 | 148 | | |
145 | 149 | | |
146 | 150 | | |
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| 154 | + | |
150 | 155 | | |
151 | 156 | | |
152 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
153 | 164 | | |
154 | 165 | | |
155 | 166 | | |
| |||
283 | 294 | | |
284 | 295 | | |
285 | 296 | | |
286 | | - | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
287 | 301 | | |
288 | 302 | | |
289 | 303 | | |
| |||
305 | 319 | | |
306 | 320 | | |
307 | 321 | | |
308 | | - | |
| 322 | + | |
309 | 323 | | |
310 | 324 | | |
311 | 325 | | |
| |||
Lines changed: 52 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
195 | | - | |
196 | 191 | | |
197 | 192 | | |
198 | 193 | | |
| |||
330 | 325 | | |
331 | 326 | | |
332 | 327 | | |
333 | | - | |
| 328 | + | |
334 | 329 | | |
335 | 330 | | |
336 | 331 | | |
| |||
353 | 348 | | |
354 | 349 | | |
355 | 350 | | |
356 | | - | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
357 | 374 | | |
358 | 375 | | |
359 | 376 | | |
| |||
374 | 391 | | |
375 | 392 | | |
376 | 393 | | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
377 | 421 | | |
378 | 422 | | |
379 | 423 | | |
| |||
0 commit comments