Functions

    Trigonometric

    FunctionSpecificationExample
    acosacos(number T) -> doubleSELECT acos(0.5) FROM my-index LIMIT 1
    asinasin(number T) -> doubleSELECT asin(0.5) FROM my-index LIMIT 1
    atanatan(number T) -> doubleSELECT atan(0.5) FROM my-index LIMIT 1
    atan2atan2(number T, number) -> doubleSELECT atan2(1, 0.5) FROM my-index LIMIT 1
    coscos(number T) -> doubleSELECT cos(0.5) FROM my-index LIMIT 1
    coshcosh(number T) -> doubleSELECT cosh(0.5) FROM my-index LIMIT 1
    cotcot(number T) -> doubleSELECT cot(0.5) FROM my-index LIMIT 1
    degreesdegrees(number T) -> doubleSELECT degrees(0.5) FROM my-index LIMIT 1
    radiansradians(number T) -> doubleSELECT radians(0.5) FROM my-index LIMIT 1
    sinsin(number T) -> doubleSELECT sin(0.5) FROM my-index LIMIT 1
    sinhsinh(number T) -> doubleSELECT sinh(0.5) FROM my-index LIMIT 1
    tantan(number T) -> doubleSELECT tan(0.5) FROM my-index LIMIT 1

    String

    FunctionSpecificationExample
    asciiascii(string T) -> integerSELECT ascii(name.keyword) FROM my-index LIMIT 1
    concatconcat(str1, str2) -> stringSELECT concat(‘hello’, ‘world’) FROM my-index LIMIT 1
    concat_wsconcat_ws(separator, string, string…) -> stringSELECT concat_ws(“-“, “Tutorial”, “is”, “fun!”) FROM my-index LIMIT 1
    leftleft(string T, integer) -> TSELECT left(‘hello’, 2) FROM my-index LIMIT 1
    lengthlength(string) -> integerSELECT length(‘hello’) FROM my-index LIMIT 1
    locatelocate(string, string, integer) -> integer or locate(string, string) -> INTEGERSELECT locate(‘o’, ‘hello’) FROM my-index LIMIT 1, SELECT locate(‘l’, ‘hello’, 3) FROM my-index LIMIT 1
    replacereplace(string T, string, string) -> TSELECT replace(‘hello’, ‘l’, ‘x’) FROM my-index LIMIT 1
    rightright(string T, integer) -> TSELECT right(‘hello’, 1) FROM my-index LIMIT 1
    rtrimrtrim(string T) -> TSELECT rtrim(name.keyword) FROM my-index LIMIT 1
    substringsubstring(string T, integer, integer) -> TSELECT substring(name.keyword, 2,5) FROM my-index LIMIT 1
    trimtrim(string T) -> TSELECT trim(‘ hello’) FROM my-index LIMIT 1
    upperupper(string T) -> TSELECT upper(‘helloworld’) FROM my-index LIMIT 1

    Advanced

    FunctionSpecificationExample
    ifif(boolean, es_type, es_type) -> es_typeSELECT if(false, 0, 1) FROM my-index LIMIT 1, SELECT if(true, 0, 1) FROM my-index LIMIT 1
    ifnullifnull(es_type, es_type) -> es_typeSELECT ifnull(‘hello’, 1) FROM my-index LIMIT 1, SELECT ifnull(null, 1) FROM my-index LIMIT 1
    isnullisnull(es_type) -> integerSELECT isnull(null) FROM my-index LIMIT 1, SELECT isnull(1) FROM my-index LIMIT 1