Commit 7a444df
committed
Move index analyzer management to FieldMapper/MapperService (elastic#63937)
Index-time analyzers are currently specified on the MappedFieldType. This
has a number of unfortunate consequences; for example, field mappers that
index data into implementation sub-fields, such as prefix or phrase
accelerators on text fields, need to expose these sub-fields as MappedFieldTypes,
which means that they then appear in field caps, are externally searchable,
etc. It also adds index-time logic to a class that should only be concerned
with search-time behaviour.
This commit removes references to the index analyzer from MappedFieldType.
Instead, FieldMappers that use the terms index can pass either a single analyzer
or a Map of fields to analyzers to their super constructor, which are then
exposed via a new FieldMapper#indexAnalyzers() method; all index-time analysis
is mediated through the delegating analyzer wrapper on MapperService.
In a follow-up, this will make it possible to register multiple field analyzers from
a single FieldMapper, removing the need for 'hidden' mapper implementations
on text field, parent joins, and elsewhere.1 parent 1091d1b commit 7a444df
File tree
53 files changed
+457
-381
lines changed- modules
- mapper-extras/src
- main/java/org/elasticsearch/index/mapper
- test/java/org/elasticsearch/index/mapper
- parent-join/src/main/java/org/elasticsearch/join/mapper
- plugins
- analysis-icu/src/main/java/org/elasticsearch/index/mapper
- mapper-annotated-text/src/main/java/org/elasticsearch/index/mapper/annotatedtext
- server/src
- main/java/org/elasticsearch
- action/admin/indices/analyze
- index
- analysis
- mapper
- query
- termvectors
- search
- aggregations/bucket/terms
- fetch
- subphase/highlight
- test/java/org/elasticsearch
- action/admin/indices/rollover
- index/mapper
- search/aggregations/bucket/terms
- test/framework/src/main/java/org/elasticsearch/search/aggregations
- x-pack/plugin
- mapper-flattened/src/main/java/org/elasticsearch/xpack/flattened/mapper
- mapper-version/src/main/java/org/elasticsearch/xpack/versionfield
- wildcard/src/main/java/org/elasticsearch/xpack/wildcard/mapper
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
53 files changed
+457
-381
lines changedLines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | 94 | | |
96 | 95 | | |
97 | 96 | | |
| |||
136 | 135 | | |
137 | 136 | | |
138 | 137 | | |
139 | | - | |
| 138 | + | |
140 | 139 | | |
141 | 140 | | |
142 | 141 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | 71 | | |
73 | 72 | | |
74 | 73 | | |
| |||
99 | 98 | | |
100 | 99 | | |
101 | 100 | | |
102 | | - | |
| 101 | + | |
103 | 102 | | |
104 | 103 | | |
105 | 104 | | |
| |||
modules/mapper-extras/src/main/java/org/elasticsearch/index/mapper/SearchAsYouTypeFieldMapper.java
Lines changed: 29 additions & 32 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
60 | 61 | | |
61 | 62 | | |
62 | 63 | | |
| |||
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
| 99 | + | |
| 100 | + | |
104 | 101 | | |
105 | 102 | | |
106 | 103 | | |
107 | 104 | | |
108 | | - | |
109 | | - | |
| 105 | + | |
| 106 | + | |
110 | 107 | | |
111 | 108 | | |
112 | 109 | | |
| |||
120 | 117 | | |
121 | 118 | | |
122 | 119 | | |
123 | | - | |
| 120 | + | |
124 | 121 | | |
125 | 122 | | |
126 | 123 | | |
| |||
130 | 127 | | |
131 | 128 | | |
132 | 129 | | |
133 | | - | |
| 130 | + | |
134 | 131 | | |
135 | | - | |
136 | | - | |
137 | | - | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
138 | 135 | | |
139 | 136 | | |
140 | 137 | | |
141 | 138 | | |
142 | 139 | | |
143 | | - | |
| 140 | + | |
144 | 141 | | |
145 | 142 | | |
146 | 143 | | |
| |||
159 | 156 | | |
160 | 157 | | |
161 | 158 | | |
| 159 | + | |
| 160 | + | |
162 | 161 | | |
163 | 162 | | |
164 | 163 | | |
165 | 164 | | |
166 | 165 | | |
167 | | - | |
| 166 | + | |
| 167 | + | |
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
| 186 | + | |
186 | 187 | | |
| 188 | + | |
187 | 189 | | |
188 | 190 | | |
189 | 191 | | |
| |||
203 | 205 | | |
204 | 206 | | |
205 | 207 | | |
206 | | - | |
207 | 208 | | |
208 | 209 | | |
| 210 | + | |
| 211 | + | |
209 | 212 | | |
| 213 | + | |
210 | 214 | | |
211 | 215 | | |
212 | 216 | | |
213 | | - | |
| 217 | + | |
214 | 218 | | |
215 | 219 | | |
216 | 220 | | |
| |||
546 | 550 | | |
547 | 551 | | |
548 | 552 | | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | | - | |
554 | 553 | | |
555 | 554 | | |
556 | 555 | | |
| 556 | + | |
557 | 557 | | |
558 | 558 | | |
559 | 559 | | |
560 | 560 | | |
| 561 | + | |
561 | 562 | | |
562 | 563 | | |
563 | 564 | | |
564 | | - | |
| 565 | + | |
565 | 566 | | |
566 | 567 | | |
567 | 568 | | |
568 | | - | |
569 | | - | |
570 | | - | |
571 | | - | |
| 569 | + | |
572 | 570 | | |
573 | 571 | | |
574 | 572 | | |
| |||
578 | 576 | | |
579 | 577 | | |
580 | 578 | | |
581 | | - | |
| 579 | + | |
582 | 580 | | |
583 | 581 | | |
584 | 582 | | |
585 | 583 | | |
586 | | - | |
| 584 | + | |
587 | 585 | | |
588 | 586 | | |
589 | 587 | | |
| |||
599 | 597 | | |
600 | 598 | | |
601 | 599 | | |
602 | | - | |
603 | 600 | | |
604 | | - | |
| 601 | + | |
605 | 602 | | |
606 | 603 | | |
607 | 604 | | |
| |||
Lines changed: 34 additions & 24 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
65 | 66 | | |
66 | 67 | | |
67 | 68 | | |
| |||
180 | 181 | | |
181 | 182 | | |
182 | 183 | | |
183 | | - | |
| 184 | + | |
184 | 185 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
189 | 190 | | |
190 | 191 | | |
191 | 192 | | |
| |||
201 | 202 | | |
202 | 203 | | |
203 | 204 | | |
204 | | - | |
| 205 | + | |
205 | 206 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
212 | 213 | | |
213 | 214 | | |
214 | 215 | | |
| |||
600 | 601 | | |
601 | 602 | | |
602 | 603 | | |
603 | | - | |
| 604 | + | |
604 | 605 | | |
605 | 606 | | |
606 | 607 | | |
607 | | - | |
| 608 | + | |
608 | 609 | | |
609 | 610 | | |
610 | 611 | | |
611 | 612 | | |
612 | 613 | | |
613 | | - | |
| 614 | + | |
| 615 | + | |
614 | 616 | | |
615 | 617 | | |
616 | 618 | | |
617 | 619 | | |
618 | 620 | | |
619 | 621 | | |
620 | | - | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
621 | 625 | | |
622 | 626 | | |
623 | 627 | | |
624 | 628 | | |
625 | | - | |
| 629 | + | |
| 630 | + | |
626 | 631 | | |
627 | 632 | | |
628 | 633 | | |
629 | | - | |
630 | | - | |
| 634 | + | |
| 635 | + | |
631 | 636 | | |
632 | 637 | | |
633 | 638 | | |
634 | 639 | | |
635 | 640 | | |
636 | | - | |
| 641 | + | |
| 642 | + | |
637 | 643 | | |
638 | 644 | | |
639 | 645 | | |
640 | 646 | | |
| 647 | + | |
641 | 648 | | |
642 | 649 | | |
643 | | - | |
| 650 | + | |
644 | 651 | | |
645 | 652 | | |
646 | 653 | | |
| |||
653 | 660 | | |
654 | 661 | | |
655 | 662 | | |
656 | | - | |
657 | | - | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
658 | 668 | | |
659 | 669 | | |
660 | 670 | | |
661 | | - | |
| 671 | + | |
662 | 672 | | |
663 | 673 | | |
664 | 674 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | 116 | | |
118 | 117 | | |
119 | 118 | | |
| |||
0 commit comments