|
11 | 11 | import org.apache.lucene.util.SetOnce;
|
12 | 12 | import org.elasticsearch.ExceptionsHelper;
|
13 | 13 | import org.elasticsearch.index.IndexSettings;
|
14 |
| -import org.elasticsearch.index.fielddata.FieldData; |
15 | 14 | import org.elasticsearch.index.fielddata.IndexFieldData;
|
16 | 15 | import org.elasticsearch.index.fielddata.IndexFieldDataCache;
|
17 | 16 | import org.elasticsearch.index.fielddata.IndexNumericFieldData;
|
18 |
| -import org.elasticsearch.index.fielddata.LeafNumericFieldData; |
19 |
| -import org.elasticsearch.index.fielddata.ScriptDocValues; |
20 | 17 | import org.elasticsearch.index.fielddata.SearchLookupAware;
|
21 |
| -import org.elasticsearch.index.fielddata.SortedBinaryDocValues; |
22 |
| -import org.elasticsearch.index.fielddata.SortedNumericDoubleValues; |
| 18 | +import org.elasticsearch.index.fielddata.plain.LeafLongFieldData; |
23 | 19 | import org.elasticsearch.index.mapper.MappedFieldType;
|
24 | 20 | import org.elasticsearch.index.mapper.MapperService;
|
25 | 21 | import org.elasticsearch.indices.breaker.CircuitBreakerService;
|
@@ -108,41 +104,17 @@ protected boolean sortRequiresCustomComparator() {
|
108 | 104 | @Override
|
109 | 105 | public void clear() {}
|
110 | 106 |
|
111 |
| - public static class ScriptLongLeafFieldData implements LeafNumericFieldData { |
112 |
| - private final ScriptLongDocValues scriptBinaryDocValues; |
| 107 | + public static class ScriptLongLeafFieldData extends LeafLongFieldData { |
| 108 | + private final ScriptLongDocValues scriptLongDocValues; |
113 | 109 |
|
114 |
| - ScriptLongLeafFieldData(ScriptLongDocValues scriptBinaryDocValues) { |
115 |
| - this.scriptBinaryDocValues = scriptBinaryDocValues; |
116 |
| - } |
117 |
| - |
118 |
| - @Override |
119 |
| - public ScriptDocValues<?> getScriptValues() { |
120 |
| - return new ScriptDocValues.Longs(getLongValues()); |
121 |
| - } |
122 |
| - |
123 |
| - @Override |
124 |
| - public SortedBinaryDocValues getBytesValues() { |
125 |
| - return FieldData.toString(scriptBinaryDocValues); |
126 |
| - } |
127 |
| - |
128 |
| - @Override |
129 |
| - public SortedNumericDoubleValues getDoubleValues() { |
130 |
| - return FieldData.castToDouble(getLongValues()); |
| 110 | + ScriptLongLeafFieldData(ScriptLongDocValues scriptLongDocValues) { |
| 111 | + super(0, NumericType.LONG); |
| 112 | + this.scriptLongDocValues = scriptLongDocValues; |
131 | 113 | }
|
132 | 114 |
|
133 | 115 | @Override
|
134 | 116 | public SortedNumericDocValues getLongValues() {
|
135 |
| - return scriptBinaryDocValues; |
136 |
| - } |
137 |
| - |
138 |
| - @Override |
139 |
| - public long ramBytesUsed() { |
140 |
| - return 0; |
141 |
| - } |
142 |
| - |
143 |
| - @Override |
144 |
| - public void close() { |
145 |
| - |
| 117 | + return scriptLongDocValues; |
146 | 118 | }
|
147 | 119 | }
|
148 | 120 | }
|
0 commit comments