Skip to content

Commit 23e0a76

Browse files
authored
ESQL docs: Push down needs index and doc_values (#110353) (#110394)
This adds a `NOTE` to each comparison saying that pushing the comparison to the search index requires that the field have an `index` and `doc_values`. This is unique compared to the rest of Elasticsearch which only requires an `index` and it's caused by our insistence that comparisons only return true for single-valued fields. We can in future accelerate comparisons without `doc_values`, but we just haven't written that code yet.
1 parent 68de9a1 commit 23e0a76

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

docs/reference/esql/functions/binary.asciidoc

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
[.text-center]
88
image::esql/functions/signature/equals.svg[Embedded,opts=inline]
99

10+
Check if two fields are equal. If either field is <<esql-multivalued-fields,multivalued>> then
11+
the result is `null`.
12+
13+
NOTE: This is pushed to the underlying search index if one side of the comparison is constant
14+
and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
15+
1016
Supported types:
1117

1218
include::types/equals.asciidoc[]
@@ -15,6 +21,12 @@ include::types/equals.asciidoc[]
1521
[.text-center]
1622
image::esql/functions/signature/not_equals.svg[Embedded,opts=inline]
1723

24+
Check if two fields are unequal. If either field is <<esql-multivalued-fields,multivalued>> then
25+
the result is `null`.
26+
27+
NOTE: This is pushed to the underlying search index if one side of the comparison is constant
28+
and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
29+
1830
Supported types:
1931

2032
include::types/not_equals.asciidoc[]
@@ -23,55 +35,112 @@ include::types/not_equals.asciidoc[]
2335
[.text-center]
2436
image::esql/functions/signature/less_than.svg[Embedded,opts=inline]
2537

38+
Check if one field is less than another. If either field is <<esql-multivalued-fields,multivalued>>
39+
then the result is `null`.
40+
41+
NOTE: This is pushed to the underlying search index if one side of the comparison is constant
42+
and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
43+
44+
Supported types:
45+
2646
include::types/less_than.asciidoc[]
2747

2848
==== Less than or equal to `<=`
2949
[.text-center]
3050
image::esql/functions/signature/less_than_or_equal.svg[Embedded,opts=inline]
3151

52+
Check if one field is less than or equal to another. If either field is <<esql-multivalued-fields,multivalued>>
53+
then the result is `null`.
54+
55+
NOTE: This is pushed to the underlying search index if one side of the comparison is constant
56+
and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
57+
58+
Supported types:
59+
3260
include::types/less_than_or_equal.asciidoc[]
3361

3462
==== Greater than `>`
3563
[.text-center]
3664
image::esql/functions/signature/greater_than.svg[Embedded,opts=inline]
3765

66+
Check if one field is greater than another. If either field is <<esql-multivalued-fields,multivalued>>
67+
then the result is `null`.
68+
69+
NOTE: This is pushed to the underlying search index if one side of the comparison is constant
70+
and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
71+
72+
Supported types:
73+
3874
include::types/greater_than.asciidoc[]
3975

4076
==== Greater than or equal to `>=`
4177
[.text-center]
4278
image::esql/functions/signature/greater_than_or_equal.svg[Embedded,opts=inline]
4379

80+
Check if one field is greater than or equal to another. If either field is <<esql-multivalued-fields,multivalued>>
81+
then the result is `null`.
82+
83+
NOTE: This is pushed to the underlying search index if one side of the comparison is constant
84+
and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
85+
86+
Supported types:
87+
4488
include::types/greater_than_or_equal.asciidoc[]
4589

4690
==== Add `+`
4791
[.text-center]
4892
image::esql/functions/signature/add.svg[Embedded,opts=inline]
4993

94+
Add two numbers together. If either field is <<esql-multivalued-fields,multivalued>>
95+
then the result is `null`.
96+
97+
Supported types:
98+
5099
include::types/add.asciidoc[]
51100

52101
==== Subtract `-`
53102
[.text-center]
54103
image::esql/functions/signature/sub.svg[Embedded,opts=inline]
55104

105+
Subtract one number from another. If either field is <<esql-multivalued-fields,multivalued>>
106+
then the result is `null`.
107+
108+
Supported types:
109+
56110
include::types/sub.asciidoc[]
57111

58112
==== Multiply `*`
59113
[.text-center]
60114
image::esql/functions/signature/mul.svg[Embedded,opts=inline]
61115

116+
Multiply two numbers together. If either field is <<esql-multivalued-fields,multivalued>>
117+
then the result is `null`.
118+
119+
Supported types:
120+
62121
include::types/mul.asciidoc[]
63122

64123
==== Divide `/`
65124
[.text-center]
66125
image::esql/functions/signature/div.svg[Embedded,opts=inline]
67126

127+
Divide one number by another. If either field is <<esql-multivalued-fields,multivalued>>
128+
then the result is `null`.
129+
68130
NOTE: Division of two integer types will yield an integer result, rounding towards 0.
69131
If you need floating point division, wrap one of the arguments in <<esql-to_double>>.
70132

133+
Supported types:
134+
71135
include::types/div.asciidoc[]
72136

73137
==== Modulus `%`
74138
[.text-center]
75139
image::esql/functions/signature/mod.svg[Embedded,opts=inline]
76140

141+
Divide one number by another and return the remainder. If either field is <<esql-multivalued-fields,multivalued>>
142+
then the result is `null`.
143+
144+
Supported types:
145+
77146
include::types/mod.asciidoc[]

0 commit comments

Comments
 (0)