Commit f05af0a
authored
Enable index-time sorting (#24055)
This change adds an index setting to define how the documents should be sorted inside each Segment.
It allows any numeric, date, boolean or keyword field inside a mapping to be used to sort the index on disk.
It is not allowed to use a `nested` fields inside an index that defines an index sorting since `nested` fields relies on the original sort of the index.
This change does not add early termination capabilities in the search layer. This will be added in a follow up.
Relates #67201 parent c0ac50e commit f05af0a
File tree
28 files changed
+1313
-47
lines changed- core/src
- main/java/org/elasticsearch
- action/admin/indices
- segments
- shrink
- cluster/metadata
- common/settings
- index
- engine
- mapper
- shard
- test/java/org/elasticsearch
- action/admin/indices/create
- index
- engine
- mapper
- shard
- indices/cluster
- docs/reference/index-modules
- rest-api-spec/src/main/resources/rest-api-spec/test/indices.sort
- test/framework/src/main/java/org/elasticsearch
- index/shard
- test
28 files changed
+1313
-47
lines changedLines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
22 | 26 | | |
23 | 27 | | |
24 | 28 | | |
| |||
37 | 41 | | |
38 | 42 | | |
39 | 43 | | |
| 44 | + | |
40 | 45 | | |
41 | 46 | | |
42 | 47 | | |
| |||
140 | 145 | | |
141 | 146 | | |
142 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
143 | 151 | | |
144 | 152 | | |
145 | 153 | | |
| |||
164 | 172 | | |
165 | 173 | | |
166 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
167 | 194 | | |
168 | 195 | | |
169 | 196 | | |
| |||
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
69 | 72 | | |
70 | 73 | | |
71 | 74 | | |
| |||
Lines changed: 14 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
374 | 374 | | |
375 | 375 | | |
376 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
377 | 385 | | |
378 | 386 | | |
379 | 387 | | |
| 388 | + | |
380 | 389 | | |
381 | 390 | | |
382 | 391 | | |
| |||
581 | 590 | | |
582 | 591 | | |
583 | 592 | | |
| 593 | + | |
584 | 594 | | |
585 | 595 | | |
586 | | - | |
587 | | - | |
| 596 | + | |
| 597 | + | |
588 | 598 | | |
589 | 599 | | |
590 | 600 | | |
591 | 601 | | |
592 | 602 | | |
593 | 603 | | |
594 | 604 | | |
595 | | - | |
| 605 | + | |
596 | 606 | | |
597 | 607 | | |
598 | 608 | | |
599 | | - | |
| 609 | + | |
600 | 610 | | |
601 | 611 | | |
602 | 612 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
27 | | - | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
| |||
Lines changed: 23 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | 23 | | |
| 24 | + | |
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| 87 | + | |
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| |||
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
| 123 | + | |
122 | 124 | | |
123 | 125 | | |
124 | 126 | | |
| |||
153 | 155 | | |
154 | 156 | | |
155 | 157 | | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
156 | 168 | | |
157 | 169 | | |
158 | 170 | | |
| |||
243 | 255 | | |
244 | 256 | | |
245 | 257 | | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
246 | 262 | | |
247 | 263 | | |
248 | 264 | | |
| |||
350 | 366 | | |
351 | 367 | | |
352 | 368 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
357 | 373 | | |
358 | 374 | | |
359 | 375 | | |
| |||
401 | 417 | | |
402 | 418 | | |
403 | 419 | | |
404 | | - | |
| 420 | + | |
| 421 | + | |
405 | 422 | | |
406 | 423 | | |
407 | 424 | | |
| |||
Lines changed: 13 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
| 105 | + | |
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
278 | 279 | | |
279 | 280 | | |
280 | 281 | | |
| 282 | + | |
281 | 283 | | |
282 | 284 | | |
283 | 285 | | |
| |||
499 | 501 | | |
500 | 502 | | |
501 | 503 | | |
502 | | - | |
| 504 | + | |
503 | 505 | | |
504 | 506 | | |
505 | 507 | | |
| |||
509 | 511 | | |
510 | 512 | | |
511 | 513 | | |
512 | | - | |
| 514 | + | |
513 | 515 | | |
514 | 516 | | |
515 | 517 | | |
| |||
574 | 576 | | |
575 | 577 | | |
576 | 578 | | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
577 | 586 | | |
578 | 587 | | |
0 commit comments