Expressions, functions, and operators
Sphinx lets you use arbitrary arithmetic expressions both via SphinxQL and SphinxAPI, involving attribute values, internal attributes (document ID and relevance weight), arithmetic operations, a number of built-in functions, and user-defined functions. This section documents the supported operators and functions. Here's the complete reference list for quick access.
- Arithmetic operators: +, -, *, /, %, DIV, MOD
- Comparison operators: <, > <=, >=, =, <>
- Boolean operators: AND, OR, NOT
- Bitwise operators: &, |
- ABS()
- ALL()
- ANY()
- ATAN2()
- BIGINT()
- BITDOT()
- CEIL()
- CONTAINS()
- COS()
- CRC32()
- DAY()
- DOUBLE()
- EXP()
- FIBONACCI()
- FLOOR()
- GEODIST()
- GEOPOLY2D()
- GREATEST()
- IDIV()
- IF()
- IN()
- INDEXOF()
- INTEGER()
- INTERVAL()
- LEAST()
- LENGTH()
- LN()
- LOG10()
- LOG2()
- MAX()
- MIN()
- MIN_TOP_SORTVAL()
- MIN_TOP_WEIGHT()
- MONTH()
- NOW()
- POLY2D()
- POW()
- REMAP()
- SIN()
- SINT()
- SQRT()
- UINT()
- YEAR()
- YEARMONTH()
- YEARMONTHDAY()
