binary.asciidoc 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. [discrete]
  2. [[esql-binary-operators]]
  3. === Binary operators
  4. [[esql-binary-operators-equality]]
  5. ==== Equality
  6. [.text-center]
  7. image::esql/functions/signature/equals.svg[Embedded,opts=inline]
  8. Check if two fields are equal. If either field is <<esql-multivalued-fields,multivalued>> then
  9. the result is `null`.
  10. NOTE: This is pushed to the underlying search index if one side of the comparison is constant
  11. and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
  12. Supported types:
  13. include::types/equals.asciidoc[]
  14. ==== Inequality `!=`
  15. [.text-center]
  16. image::esql/functions/signature/not_equals.svg[Embedded,opts=inline]
  17. Check if two fields are unequal. If either field is <<esql-multivalued-fields,multivalued>> then
  18. the result is `null`.
  19. NOTE: This is pushed to the underlying search index if one side of the comparison is constant
  20. and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
  21. Supported types:
  22. include::types/not_equals.asciidoc[]
  23. ==== Less than `<`
  24. [.text-center]
  25. image::esql/functions/signature/less_than.svg[Embedded,opts=inline]
  26. Check if one field is less than another. If either field is <<esql-multivalued-fields,multivalued>>
  27. then the result is `null`.
  28. NOTE: This is pushed to the underlying search index if one side of the comparison is constant
  29. and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
  30. Supported types:
  31. include::types/less_than.asciidoc[]
  32. ==== Less than or equal to `<=`
  33. [.text-center]
  34. image::esql/functions/signature/less_than_or_equal.svg[Embedded,opts=inline]
  35. Check if one field is less than or equal to another. If either field is <<esql-multivalued-fields,multivalued>>
  36. then the result is `null`.
  37. NOTE: This is pushed to the underlying search index if one side of the comparison is constant
  38. and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
  39. Supported types:
  40. include::types/less_than_or_equal.asciidoc[]
  41. ==== Greater than `>`
  42. [.text-center]
  43. image::esql/functions/signature/greater_than.svg[Embedded,opts=inline]
  44. Check if one field is greater than another. If either field is <<esql-multivalued-fields,multivalued>>
  45. then the result is `null`.
  46. NOTE: This is pushed to the underlying search index if one side of the comparison is constant
  47. and the other side is a field in the index that has both an <<mapping-index>> and <<doc-values>>.
  48. Supported types:
  49. include::types/greater_than.asciidoc[]
  50. ==== Greater than or equal to `>=`
  51. [.text-center]
  52. image::esql/functions/signature/greater_than_or_equal.svg[Embedded,opts=inline]
  53. Check if one field is greater than or equal to another. If either field is <<esql-multivalued-fields,multivalued>>
  54. then the result is `null`.
  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. Supported types:
  58. include::types/greater_than_or_equal.asciidoc[]
  59. ==== Add `+`
  60. [.text-center]
  61. image::esql/functions/signature/add.svg[Embedded,opts=inline]
  62. Add two numbers together. If either field is <<esql-multivalued-fields,multivalued>>
  63. then the result is `null`.
  64. Supported types:
  65. include::types/add.asciidoc[]
  66. ==== Subtract `-`
  67. [.text-center]
  68. image::esql/functions/signature/sub.svg[Embedded,opts=inline]
  69. Subtract one number from another. If either field is <<esql-multivalued-fields,multivalued>>
  70. then the result is `null`.
  71. Supported types:
  72. include::types/sub.asciidoc[]
  73. ==== Multiply `*`
  74. [.text-center]
  75. image::esql/functions/signature/mul.svg[Embedded,opts=inline]
  76. Multiply two numbers together. If either field is <<esql-multivalued-fields,multivalued>>
  77. then the result is `null`.
  78. Supported types:
  79. include::types/mul.asciidoc[]
  80. ==== Divide `/`
  81. [.text-center]
  82. image::esql/functions/signature/div.svg[Embedded,opts=inline]
  83. Divide one number by another. If either field is <<esql-multivalued-fields,multivalued>>
  84. then the result is `null`.
  85. NOTE: Division of two integer types will yield an integer result, rounding towards 0.
  86. If you need floating point division, <<esql-cast-operator>> one of the arguments to a `DOUBLE`.
  87. Supported types:
  88. include::types/div.asciidoc[]
  89. ==== Modulus `%`
  90. [.text-center]
  91. image::esql/functions/signature/mod.svg[Embedded,opts=inline]
  92. Divide one number by another and return the remainder. If either field is <<esql-multivalued-fields,multivalued>>
  93. then the result is `null`.
  94. Supported types:
  95. include::types/mod.asciidoc[]