123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- [discrete]
- [[esql-binary-operators]]
- === Binary operators
- [[esql-binary-operators-equality]]
- ==== Equality
- [.text-center]
- image::esql/functions/signature/equals.svg[Embedded,opts=inline]
- Check if two fields are equal. If either field is <<esql-multivalued-fields,multivalued>> then
- the result is `null`.
- NOTE: This is pushed to the underlying search index if one side of the comparison is constant
- and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
- Supported types:
- include::types/equals.asciidoc[]
- ==== Inequality `!=`
- [.text-center]
- image::esql/functions/signature/not_equals.svg[Embedded,opts=inline]
- Check if two fields are unequal. If either field is <<esql-multivalued-fields,multivalued>> then
- the result is `null`.
- NOTE: This is pushed to the underlying search index if one side of the comparison is constant
- and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
- Supported types:
- include::types/not_equals.asciidoc[]
- ==== Less than `<`
- [.text-center]
- image::esql/functions/signature/less_than.svg[Embedded,opts=inline]
- Check if one field is less than another. If either field is <<esql-multivalued-fields,multivalued>>
- then the result is `null`.
- NOTE: This is pushed to the underlying search index if one side of the comparison is constant
- and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
- Supported types:
- include::types/less_than.asciidoc[]
- ==== Less than or equal to `<=`
- [.text-center]
- image::esql/functions/signature/less_than_or_equal.svg[Embedded,opts=inline]
- Check if one field is less than or equal to another. If either field is <<esql-multivalued-fields,multivalued>>
- then the result is `null`.
- NOTE: This is pushed to the underlying search index if one side of the comparison is constant
- and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
- Supported types:
- include::types/less_than_or_equal.asciidoc[]
- ==== Greater than `>`
- [.text-center]
- image::esql/functions/signature/greater_than.svg[Embedded,opts=inline]
- Check if one field is greater than another. If either field is <<esql-multivalued-fields,multivalued>>
- then the result is `null`.
- NOTE: This is pushed to the underlying search index if one side of the comparison is constant
- and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
- Supported types:
- include::types/greater_than.asciidoc[]
- ==== Greater than or equal to `>=`
- [.text-center]
- image::esql/functions/signature/greater_than_or_equal.svg[Embedded,opts=inline]
- Check if one field is greater than or equal to another. If either field is <<esql-multivalued-fields,multivalued>>
- then the result is `null`.
- NOTE: This is pushed to the underlying search index if one side of the comparison is constant
- and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
- Supported types:
- include::types/greater_than_or_equal.asciidoc[]
- [[esql-add]]
- ==== Add `+`
- [.text-center]
- image::esql/functions/signature/add.svg[Embedded,opts=inline]
- Add two numbers together. If either field is <<esql-multivalued-fields,multivalued>>
- then the result is `null`.
- Supported types:
- include::types/add.asciidoc[]
- [[esql-subtract]]
- ==== Subtract `-`
- [.text-center]
- image::esql/functions/signature/sub.svg[Embedded,opts=inline]
- Subtract one number from another. If either field is <<esql-multivalued-fields,multivalued>>
- then the result is `null`.
- Supported types:
- include::types/sub.asciidoc[]
- ==== Multiply `*`
- [.text-center]
- image::esql/functions/signature/mul.svg[Embedded,opts=inline]
- Multiply two numbers together. If either field is <<esql-multivalued-fields,multivalued>>
- then the result is `null`.
- Supported types:
- include::types/mul.asciidoc[]
- ==== Divide `/`
- [.text-center]
- image::esql/functions/signature/div.svg[Embedded,opts=inline]
- Divide one number by another. If either field is <<esql-multivalued-fields,multivalued>>
- then the result is `null`.
- NOTE: Division of two integer types will yield an integer result, rounding towards 0.
- If you need floating point division, <<esql-cast-operator>> one of the arguments to a `DOUBLE`.
- Supported types:
- include::types/div.asciidoc[]
- ==== Modulus `%`
- [.text-center]
- image::esql/functions/signature/mod.svg[Embedded,opts=inline]
- Divide one number by another and return the remainder. If either field is <<esql-multivalued-fields,multivalued>>
- then the result is `null`.
- Supported types:
- include::types/mod.asciidoc[]
|