Skip to content

Commit fe74f97

Browse files
authored
Script: fields API for byte, double, float, integer, long, short (#81126)
Adds DocValuesField for byte, double, float, integer, long and short. The integral types implement ScriptDocValues.Supplier<Long> while the floating point types implement ScriptDocValues.Supplier<Double>. Refs: #79105
1 parent 229d2d7 commit fe74f97

File tree

14 files changed

+1354
-51
lines changed

14 files changed

+1354
-51
lines changed

modules/lang-painless/src/main/resources/org/elasticsearch/painless/org.elasticsearch.script.fields.txt

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,35 @@ class org.elasticsearch.script.field.BooleanDocValuesField @dynamic_type {
3535
boolean get(boolean)
3636
boolean get(int, boolean)
3737
}
38+
39+
class org.elasticsearch.script.field.IntegerDocValuesField @dynamic_type {
40+
int get(int)
41+
int get(int, int)
42+
}
43+
44+
class org.elasticsearch.script.field.LongDocValuesField @dynamic_type {
45+
long get(long)
46+
long get(int, long)
47+
}
48+
49+
class org.elasticsearch.script.field.DoubleDocValuesField @dynamic_type {
50+
double get(double)
51+
double get(int, double)
52+
}
53+
54+
class org.elasticsearch.script.field.FloatDocValuesField @dynamic_type {
55+
float get(float)
56+
float get(int, float)
57+
}
58+
59+
# defaults are cast to byte, taking an int facilitates resolution with constants without casting
60+
class org.elasticsearch.script.field.ByteDocValuesField @dynamic_type {
61+
byte get(int)
62+
byte get(int, int)
63+
}
64+
65+
# defaults are cast to short, taking an int facilitates resolution with constants without casting
66+
class org.elasticsearch.script.field.ShortDocValuesField @dynamic_type {
67+
short get(int)
68+
short get(int, int)
69+
}

0 commit comments

Comments
 (0)