1
0

binary.asciidoc 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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. [[esql-add]]
  60. ==== Add `+`
  61. [.text-center]
  62. image::esql/functions/signature/add.svg[Embedded,opts=inline]
  63. Add two numbers together. If either field is <<esql-multivalued-fields,multivalued>>
  64. then the result is `null`.
  65. Supported types:
  66. include::types/add.asciidoc[]
  67. [[esql-subtract]]
  68. ==== Subtract `-`
  69. [.text-center]
  70. image::esql/functions/signature/sub.svg[Embedded,opts=inline]
  71. Subtract one number from another. If either field is <<esql-multivalued-fields,multivalued>>
  72. then the result is `null`.
  73. Supported types:
  74. include::types/sub.asciidoc[]
  75. ==== Multiply `*`
  76. [.text-center]
  77. image::esql/functions/signature/mul.svg[Embedded,opts=inline]
  78. Multiply two numbers together. If either field is <<esql-multivalued-fields,multivalued>>
  79. then the result is `null`.
  80. Supported types:
  81. include::types/mul.asciidoc[]
  82. ==== Divide `/`
  83. [.text-center]
  84. image::esql/functions/signature/div.svg[Embedded,opts=inline]
  85. Divide one number by another. If either field is <<esql-multivalued-fields,multivalued>>
  86. then the result is `null`.
  87. NOTE: Division of two integer types will yield an integer result, rounding towards 0.
  88. If you need floating point division, <<esql-cast-operator>> one of the arguments to a `DOUBLE`.
  89. Supported types:
  90. include::types/div.asciidoc[]
  91. ==== Modulus `%`
  92. [.text-center]
  93. image::esql/functions/signature/mod.svg[Embedded,opts=inline]
  94. Divide one number by another and return the remainder. If either field is <<esql-multivalued-fields,multivalued>>
  95. then the result is `null`.
  96. Supported types:
  97. include::types/mod.asciidoc[]