Expressions.md.json 73 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. {
  2. "bdcce5f2284998873dcf25ffc0e3490f99e2e3ecc9aaf1c5cd21a3b1873cbb20": {
  3. "original": "# Expressions in search\n\nManticore enables the use of arbitrary arithmetic expressions through both SQL and HTTP, incorporating attribute values, internal attributes (document ID and relevance weight), arithmetic operations, several built-in functions, and user-defined functions. Below is the complete reference list for quick access.\n\n## Arithmetic operators\nCODE_BLOCK_0\n\nStandard arithmetic operators are available. Arithmetic calculations involving these operators can be executed in three different modes:\n\n1. using single-precision, 32-bit IEEE 754 floating point values (default),\n2. using signed 32-bit integers,\n3. using 64-bit signed integers.\n\nThe expression parser automatically switches to integer mode if no operations result in a floating point value. Otherwise, it uses the default floating point mode. For example, a+b will be computed using 32-bit integers if both arguments are 32-bit integers; or using 64-bit integers if both arguments are integers but one of them is 64-bit; or in floats otherwise. However, `a/b` or `sqrt(a)` will always be computed in floats, as these operations return a non-integer result. To avoid this, you can use `IDIV(a,b)` or a `DIV b` form. Additionally, `a*b` will not automatically promote to 64-bit when arguments are 32-bit. To enforce 64-bit results, use [BIGINT()](../Functions/Type_casting_functions.md#BIGINT%28%29), but note that if non-integer operations are present, BIGINT() will simply be ignored.\n\n## Comparison operators\nCODE_BLOCK_1\n\nThe comparison operators return 1.0 when the condition is true and 0.0 otherwise. For example, `(a=b)+3` evaluates to 4 when attribute `a` is equal to attribute `b`, and to 3 when `a` is not. Unlike MySQL, the equality comparisons (i.e., `=` and `<>` operators) include a small equality threshold (1e-6 by default). If the difference between the compared values is within the threshold, they are considered equal.\n\nThe `BETWEEN` and `IN` operators, in the case of multi-value attributes, return true if at least one value matches the condition (similar to [ANY()](../Functions/Arrays_and_conditions_functions.md#ANY%28%29)). The `IN` operator does not support JSON attributes. The `IS (NOT) NULL` operator is supported only for JSON attributes.\n\n## Boolean operators\nCODE_BLOCK_2\n\nBoolean operators (AND, OR, NOT) behave as expected. They are left-associative and have the lowest priority compared to other operators. NOT has higher priority than AND and OR but still less than any other operator. AND and OR share the same priority, so using parentheses is recommended to avoid confusion in complex expressions.\n\n## Bitwise operators\nCODE_BLOCK_3\n\nThese operators perform bitwise AND and OR respectively. The operands must be of integer types.",
  4. "translations": {
  5. "chinese": "# \u641c\u7d22\u4e2d\u7684\u8868\u8fbe\u5f0f\n\nManticore \u901a\u8fc7 SQL \u548c HTTP \u652f\u6301\u4f7f\u7528\u4efb\u610f\u7684\u7b97\u672f\u8868\u8fbe\u5f0f\uff0c\u7ed3\u5408\u5c5e\u6027\u503c\u3001\u5185\u90e8\u5c5e\u6027\uff08\u6587\u6863 ID \u548c\u76f8\u5173\u5ea6\u6743\u91cd\uff09\u3001\u7b97\u672f\u8fd0\u7b97\u3001\u591a\u79cd\u5185\u5efa\u51fd\u6570\u4ee5\u53ca\u7528\u6237\u81ea\u5b9a\u4e49\u51fd\u6570\u3002\u4ee5\u4e0b\u662f\u5b8c\u6574\u7684\u53c2\u8003\u5217\u8868\uff0c\u65b9\u4fbf\u5feb\u901f\u67e5\u9605\u3002\n\n## \u7b97\u672f\u8fd0\u7b97\u7b26\nCODE_BLOCK_0\n\n\u63d0\u4f9b\u6807\u51c6\u7b97\u672f\u8fd0\u7b97\u7b26\u3002\u4f7f\u7528\u8fd9\u4e9b\u8fd0\u7b97\u7b26\u7684\u7b97\u672f\u8ba1\u7b97\u53ef\u4ee5\u4ee5\u4e09\u79cd\u4e0d\u540c\u6a21\u5f0f\u6267\u884c\uff1a\n\n1. \u4f7f\u7528\u5355\u7cbe\u5ea6\u300132 \u4f4d IEEE 754 \u6d6e\u70b9\u503c\uff08\u9ed8\u8ba4\uff09\uff0c\n2. \u4f7f\u7528\u6709\u7b26\u53f7 32 \u4f4d\u6574\u6570\uff0c\n3. \u4f7f\u7528\u6709\u7b26\u53f7 64 \u4f4d\u6574\u6570\u3002\n\n\u8868\u8fbe\u5f0f\u89e3\u6790\u5668\u4f1a\u81ea\u52a8\u5207\u6362\u5230\u6574\u6570\u6a21\u5f0f\uff0c\u5982\u679c\u6ca1\u6709\u4efb\u4f55\u8fd0\u7b97\u7ed3\u679c\u4e3a\u6d6e\u70b9\u503c\u3002\u5426\u5219\uff0c\u4f7f\u7528\u9ed8\u8ba4\u7684\u6d6e\u70b9\u6a21\u5f0f\u3002\u4f8b\u5982\uff0c\u5f53\u4e24\u4e2a\u53c2\u6570\u90fd\u662f 32 \u4f4d\u6574\u6570\u65f6\uff0ca+b \u4f1a\u4ee5 32 \u4f4d\u6574\u6570\u8ba1\u7b97\uff1b\u5f53\u4e24\u4e2a\u53c2\u6570\u90fd\u662f\u6574\u6570\u4f46\u5176\u4e2d\u4e00\u4e2a\u4e3a 64 \u4f4d\u65f6\uff0c\u4f7f\u7528 64 \u4f4d\u6574\u6570\uff1b\u5426\u5219\u4ee5\u6d6e\u70b9\u8ba1\u7b97\u3002\u7136\u800c\uff0c`a/b` \u6216 `sqrt(a)` \u59cb\u7ec8\u4ee5\u6d6e\u70b9\u8ba1\u7b97\uff0c\u56e0\u4e3a\u8fd9\u4e9b\u8fd0\u7b97\u8fd4\u56de\u975e\u6574\u6570\u7ed3\u679c\u3002\u4e3a\u907f\u514d\u8fd9\u79cd\u60c5\u51b5\uff0c\u53ef\u4ee5\u4f7f\u7528 `IDIV(a,b)` \u6216 `DIV b` \u5f62\u5f0f\u3002\u53e6\u5916\uff0c\u5f53\u53c2\u6570\u662f 32 \u4f4d\u65f6\uff0c`a*b` \u4e0d\u4f1a\u81ea\u52a8\u63d0\u5347\u5230 64 \u4f4d\u3002\u82e5\u8981\u5f3a\u5236\u4f7f\u7528 64 \u4f4d\u7ed3\u679c\uff0c\u8bf7\u4f7f\u7528 [BIGINT()](../Functions/Type_casting_functions.md#BIGINT%28%29)\uff0c\u4f46\u6ce8\u610f\u5982\u679c\u5b58\u5728\u975e\u6574\u6570\u8fd0\u7b97\uff0cBIGINT() \u5c06\u88ab\u5ffd\u7565\u3002\n\n## \u6bd4\u8f83\u8fd0\u7b97\u7b26\nCODE_BLOCK_1\n\n\u6bd4\u8f83\u8fd0\u7b97\u7b26\u8fd4\u56de 1.0 \u65f6\u6761\u4ef6\u4e3a\u771f\uff0c\u8fd4\u56de 0.0 \u65f6\u6761\u4ef6\u4e3a\u5047\u3002\u4f8b\u5982\uff0c\u5f53\u5c5e\u6027 `a` \u7b49\u4e8e\u5c5e\u6027 `b` \u65f6\uff0c\u8868\u8fbe\u5f0f `(a=b)+3` \u8ba1\u7b97\u503c\u4e3a 4\uff1b\u5f53 `a` \u4e0d\u7b49\u4e8e `b` \u65f6\uff0c\u8ba1\u7b97\u503c\u4e3a 3\u3002\u4e0e MySQL \u4e0d\u540c\uff0c\u7b49\u503c\u6bd4\u8f83\uff08\u5373 `=` \u548c `<>` \u8fd0\u7b97\u7b26\uff09\u5305\u542b\u4e00\u4e2a\u5c0f\u7684\u76f8\u7b49\u9608\u503c\uff08\u9ed8\u8ba4\u662f 1e-6\uff09\u3002\u5982\u679c\u6bd4\u8f83\u503c\u7684\u5dee\u8ddd\u5728\u9608\u503c\u5185\uff0c\u5219\u8ba4\u4e3a\u5b83\u4eec\u76f8\u7b49\u3002\n\n\u5bf9\u4e8e\u591a\u503c\u5c5e\u6027\uff0c`BETWEEN` \u548c `IN` \u8fd0\u7b97\u7b26\u53ea\u8981\u81f3\u5c11\u4e00\u4e2a\u503c\u6ee1\u8db3\u6761\u4ef6\u5c31\u8fd4\u56de\u771f\uff08\u7c7b\u4f3c\u4e8e [ANY()](../Functions/Arrays_and_conditions_functions.md#ANY%28%29)\uff09\u3002`IN` \u8fd0\u7b97\u7b26\u4e0d\u652f\u6301 JSON \u5c5e\u6027\u3002`IS (NOT) NULL` \u8fd0\u7b97\u7b26\u4ec5\u652f\u6301 JSON \u5c5e\u6027\u3002\n\n## \u5e03\u5c14\u8fd0\u7b97\u7b26\nCODE_BLOCK_2\n\n\u5e03\u5c14\u8fd0\u7b97\u7b26\uff08AND\u3001OR\u3001NOT\uff09\u7684\u884c\u4e3a\u7b26\u5408\u9884\u671f\u3002\u5b83\u4eec\u662f\u5de6\u7ed3\u5408\u7684\uff0c\u5e76\u4e14\u4f18\u5148\u7ea7\u6700\u4f4e\u3002NOT \u7684\u4f18\u5148\u7ea7\u9ad8\u4e8e AND \u548c OR\uff0c\u4f46\u4ecd\u4f4e\u4e8e\u5176\u4ed6\u8fd0\u7b97\u7b26\u3002AND \u548c OR \u5177\u6709\u76f8\u540c\u4f18\u5148\u7ea7\uff0c\u5efa\u8bae\u5728\u590d\u6742\u8868\u8fbe\u5f0f\u4e2d\u4f7f\u7528\u62ec\u53f7\u4ee5\u907f\u514d\u6df7\u6dc6\u3002\n\n## \u4f4d\u8fd0\u7b97\u7b26\nCODE_BLOCK_3\n\n\u8fd9\u4e9b\u8fd0\u7b97\u7b26\u5206\u522b\u6267\u884c\u6309\u4f4d\u4e0e\u548c\u6309\u4f4d\u6216\u3002\u64cd\u4f5c\u6570\u5fc5\u987b\u662f\u6574\u6570\u7c7b\u578b\u3002",
  6. "russian": "# \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 \u043f\u043e\u0438\u0441\u043a\u0435\n\nManticore \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u0430\u043a \u0447\u0435\u0440\u0435\u0437 SQL, \u0442\u0430\u043a \u0438 \u0447\u0435\u0440\u0435\u0437 HTTP, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u0432\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b (ID \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0438 \u0432\u0435\u0441 \u0440\u0435\u043b\u0435\u0432\u0430\u043d\u0442\u043d\u043e\u0441\u0442\u0438), \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u043f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a \u0434\u043b\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0443\u043f\u0430.\n\n## \u0410\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b\nCODE_BLOCK_0\n\n\u0414\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b. \u0410\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u043c\u043e\u0433\u0443\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0432 \u0442\u0440\u0435\u0445 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0440\u0435\u0436\u0438\u043c\u0430\u0445:\n\n1. \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0447\u0438\u0441\u0435\u043b \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 32-\u0431\u0438\u0442\u043d\u043e\u0433\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u0430 IEEE 754 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e),\n2. \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0445 32-\u0431\u0438\u0442\u043d\u044b\u0445 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b,\n3. \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0437\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b.\n\n\u041f\u0430\u0440\u0441\u0435\u0440 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0440\u0435\u0436\u0438\u043c \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u0435\u0441\u043b\u0438 \u043d\u0438 \u043e\u0434\u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0435 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442 \u043a \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439. \u0412 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0440\u0435\u0436\u0438\u043c \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, a+b \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c 32-\u0431\u0438\u0442\u043d\u044b\u0445 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u0435\u0441\u043b\u0438 \u043e\u0431\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 32-\u0431\u0438\u0442\u043d\u044b\u0435 \u0446\u0435\u043b\u044b\u0435; \u0438\u043b\u0438 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0446\u0435\u043b\u044b\u0445, \u0435\u0441\u043b\u0438 \u043e\u0431\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0446\u0435\u043b\u044b\u0435, \u043d\u043e \u043e\u0434\u0438\u043d \u0438\u0437 \u043d\u0438\u0445 64-\u0431\u0438\u0442\u043d\u044b\u0439; \u0438\u043b\u0438 \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445. \u041e\u0434\u043d\u0430\u043a\u043e `a/b` \u0438\u043b\u0438 `sqrt(a)` \u0432\u0441\u0435\u0433\u0434\u0430 \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c\u0441\u044f \u0441 \u043f\u043b\u0430\u0432\u0430\u044e\u0449\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u044d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u043d\u0435\u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b. \u0427\u0442\u043e\u0431\u044b \u044d\u0442\u043e\u0433\u043e \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c `IDIV(a,b)` \u0438\u043b\u0438 \u0444\u043e\u0440\u043c\u0443 `DIV b`. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, `a*b` \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432 64-\u0431\u0438\u0442\u043d\u044b\u0435, \u0435\u0441\u043b\u0438 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b 32-\u0431\u0438\u0442\u043d\u044b\u0435. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 64-\u0431\u0438\u0442\u0430\u0445, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 [BIGINT()](../Functions/Type_casting_functions.md#BIGINT%28%29), \u043d\u043e \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043f\u0440\u0438\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u043d\u0435\u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438, BIGINT() \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0433\u043d\u043e\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f.\n\n## \u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f\nCODE_BLOCK_1\n\n\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 1.0, \u0435\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0438\u0441\u0442\u0438\u043d\u043d\u043e, \u0438 0.0 \u0432 \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, `(a=b)+3` \u0434\u0430\u0435\u0442 4, \u043a\u043e\u0433\u0434\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 `a` \u0440\u0430\u0432\u0435\u043d \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0443 `b`, \u0438 3, \u043a\u043e\u0433\u0434\u0430 `a` \u043d\u0435 \u0440\u0430\u0432\u0435\u043d. \u0412 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442 MySQL, \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430 (\u0442.\u0435., \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b `=` \u0438 `<>`) \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u043e\u0440\u043e\u0433 \u0440\u0430\u0432\u0435\u043d\u0441\u0442\u0432\u0430 (\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e 1e-6). \u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u043d\u0438\u0446\u0430 \u043c\u0435\u0436\u0434\u0443 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c\u044b\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u043f\u043e\u0440\u043e\u0433\u0430, \u043e\u043d\u0438 \u0441\u0447\u0438\u0442\u0430\u044e\u0442\u0441\u044f \u0440\u0430\u0432\u043d\u044b\u043c\u0438.\n\n\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b `BETWEEN` \u0438 `IN`, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043d\u043e\u0433\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0438\u0441\u0442\u0438\u043d\u043d\u0443, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u043d\u043e \u0438\u0437 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u0435\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u044e (\u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e [ANY()](../Functions/Arrays_and_conditions_functions.md#ANY%28%29)). \u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 `IN` \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 JSON-\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b. \u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 `IS (NOT) NULL` \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f JSON-\u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432.\n\n## \u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b\nCODE_BLOCK_2\n\n\u041b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b (AND, OR, NOT) \u0432\u0435\u0434\u0443\u0442 \u0441\u0435\u0431\u044f \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u043e. \u041e\u043d\u0438 \u0430\u0441\u0441\u043e\u0446\u0438\u0430\u0442\u0438\u0432\u043d\u044b \u0441\u043b\u0435\u0432\u0430 \u0438 \u0438\u043c\u0435\u044e\u0442 \u0441\u0430\u043c\u044b\u0439 \u043d\u0438\u0437\u043a\u0438\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442 \u043f\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044e \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438. NOT \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0438\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, \u0447\u0435\u043c AND \u0438 OR, \u043d\u043e \u0432\u0441\u0435 \u0436\u0435 \u043d\u0438\u0436\u0435, \u0447\u0435\u043c \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440. AND \u0438 OR \u0438\u043c\u0435\u044e\u0442 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0439 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043a\u043e\u0431\u043a\u0438, \u0447\u0442\u043e\u0431\u044b \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b \u0432 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u0445.\n\n## \u041f\u043e\u0431\u0438\u0442\u043e\u0432\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b\nCODE_BLOCK_3\n\n\u042d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442 \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0435 AND \u0438 OR \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e. \u041e\u043f\u0435\u0440\u0430\u043d\u0434\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u043e\u0432."
  7. },
  8. "is_code_or_comment": false,
  9. "model": "openai:gpt-4.1-mini",
  10. "updated_at": 1766339815
  11. },
  12. "3fb6e352318f448946909a7accaee76caa53602a15ba0138fa11f25fb57241e7": {
  13. "original": "## Functions:\n* [ABS()](../Functions/Mathematical_functions.md#ABS%28%29)\n* [ALL()](../Functions/Arrays_and_conditions_functions.md#ALL%28%29)\n* [ANY()](../Functions/Arrays_and_conditions_functions.md#ANY%28%29)\n* [ATAN2()](../Functions/Mathematical_functions.md#ATAN2%28%29)\n* [BIGINT()](../Functions/Type_casting_functions.md#BIGINT%28%29)\n* [BITDOT()](../Functions/Mathematical_functions.md#BITDOT%28%29)\n* [BM25F()](../Functions/Searching_and_ranking_functions.md#BM25F%28%29)\n* [CEIL()](../Functions/Mathematical_functions.md#CEIL%28%29)\n* [CONCAT()](../Functions/String_functions.md#CONCAT%28%29)\n* [CONTAINS()](../Functions/Arrays_and_conditions_functions.md#CONTAINS%28%29)\n* [COS()](../Functions/Mathematical_functions.md#COS%28%29)\n* [CRC32()](../Functions/Mathematical_functions.md#CRC32%28%29)\n* [DATE_HISTOGRAM()](../Functions/Date_and_time_functions.md#DATE_HISTOGRAM%28%29)\n* [DATE_RANGE()](../Functions/Date_and_time_functions.md#DATE_RANGE%28%29)\n* [DAY()](../Functions/Date_and_time_functions.md#DAY%28%29)\n* [DOUBLE()](../Functions/Type_casting_functions.md#DOUBLE%28%29)\n* [EXP()](../Functions/Mathematical_functions.md#EXP%28%29)\n* [FIBONACCI()](../Functions/Mathematical_functions.md#FIBONACCI%28%29)\n* [FLOOR()](../Functions/Mathematical_functions.md#FLOOR%28%29)\n* [GEODIST()](../Functions/Geo_spatial_functions.md#GEODIST%28%29)\n* [GEOPOLY2D()](../Functions/Geo_spatial_functions.md#GEOPOLY2D%28%29)\n* [GREATEST()](../Functions/Mathematical_functions.md#GREATEST%28%29)\n* [HOUR()](../Functions/Date_and_time_functions.md#HOUR%28%29)\n* [HISTOGRAM()](../Functions/Arrays_and_conditions_functions.md#HISTOGRAM%28%29)\n* [IDIV()](../Functions/Mathematical_functions.md#IDIV%28%29)\n* [IF()](../Functions/Arrays_and_conditions_functions.md#IF%28%29)\n* [IN()](../Functions/Arrays_and_conditions_functions.md#IN%28%29)\n* [INDEXOF()](../Functions/Arrays_and_conditions_functions.md#INDEXOF%28%29)\n* [INTEGER()](../Functions/Type_casting_functions.md#INTEGER%28%29)\n* [INTERVAL()](../Functions/Arrays_and_conditions_functions.md#INTERVAL%28%29)\n* [LAST_INSERT_ID()](../Functions/Other_functions.md#LAST_INSERT_ID%28%29)\n* [LEAST()](../Functions/Mathematical_functions.md#LEAST%28%29)\n* [LENGTH()](../Functions/Arrays_and_conditions_functions.md#LENGTH%28%29)\n* [LN()](../Functions/Mathematical_functions.md#LN%28%29)\n* [LOG10()](../Functions/Mathematical_functions.md#LOG10%28%29)\n* [LOG2()](../Functions/Mathematical_functions.md#LOG2%28%29)\n* [MAX()](../Functions/Mathematical_functions.md#MAX%28%29)\n* [MIN()](../Functions/Mathematical_functions.md#MIN%28%29)\n* [MINUTE()](../Functions/Date_and_time_functions.md#MINUTE%28%29)\n* [MIN_TOP_SORTVAL()](../Functions/Searching_and_ranking_functions.md#MIN_TOP_SORTVAL%28%29)\n* [MIN_TOP_WEIGHT()](../Functions/Searching_and_ranking_functions.md#MIN_TOP_WEIGHT%28%29)\n* [MONTH()](../Functions/Date_and_time_functions.md#MONTH%28%29)\n* [NOW()](../Functions/Date_and_time_functions.md#NOW%28%29)\n* [PACKEDFACTORS()](../Functions/Searching_and_ranking_functions.md#PACKEDFACTORS%28%29)\n* [POLY2D()](../Functions/Geo_spatial_functions.md#POLY2D%28%29)\n* [POW()](../Functions/Mathematical_functions.md#POW%28%29)\n* [RAND()](../Functions/Mathematical_functions.md#RAND%28%29)\n* [RANGE()](../Functions/Arrays_and_conditions_functions.md#RANGE%28%29)\n* [REGEX()](../Functions/String_functions.md#REGEX%28%29)\n* [REMAP()](../Functions/Arrays_and_conditions_functions.md#REMAP%28%29)\n* [SECOND()](../Functions/Date_and_time_functions.md#SECOND%28%29)\n* [SIN()](../Functions/Mathematical_functions.md#SIN%28%29)\n* [SINT()](../Functions/Type_casting_functions.md#SINT%28%29)\n* [SQRT()](../Functions/Mathematical_functions.md#SQRT%28%29)\n* [SUBSTRING_INDEX()](../Functions/String_functions.md#SUBSTRING_INDEX%28%29)\n* [TO_STRING()](../Functions/Type_casting_functions.md#TO_STRING%28%29)\n* [UINT()](../Functions/Type_casting_functions.md#UINT%28%29)\n* [YEAR()](../Functions/Date_and_time_functions.md#YEAR%28%29)\n* [YEARMONTH()](../Functions/Date_and_time_functions.md#YEARMONTH%28%29)\n* [YEARMONTHDAY()](../Functions/Date_and_time_functions.md#YEARMONTHDAY%28%29)\n* [WEIGHT()](../Functions/Searching_and_ranking_functions.md#WEIGHT%28%29)\n\n## Expressions in HTTP JSON\n\nIn the HTTP JSON interface, expressions are supported via `script_fields` and `expressions`.\n\n### script_fields\n\n<!-- example script_fields -->\nCODE_BLOCK_4\n\nIn this example, two expressions are created: `add_all` and `title_len`. The first expression calculates `( gid * 10 ) | crc32(title)` and stores the result in the `add_all` attribute. The second expression calculates `crc32(title)` and stores the result in the `title_len` attribute.\n\nCurrently, only `inline` expressions are supported. The value of the `inline` property (the expression to compute) has the same syntax as SQL expressions.\n\nThe expression name can be utilized in filtering or sorting.\n\n\n<!-- intro -->\n##### script_fields:\n\n<!-- request script_fields -->\nCODE_BLOCK_5\n\n<!-- end -->\n\nBy default, expression values are included in the `_source` array of the result set. If the source is selective (see [Source selection](../Searching/Search_results.md#Source-selection)), the expression name can be added to the `_source` parameter in the request. Note, the names of the expressions must be in lowercase.\n\n### expressions\n\n<!-- example expressions -->\n\n`expressions` is an alternative to `script_fields` with a simpler syntax. The example request adds two expressions and stores the results into `add_all` and `title_len` attributes. Note, the names of the expressions must be in lowercase.\n\n<!-- request expressions -->\nCODE_BLOCK_6\n\n<!-- end -->\n\n<!-- proofread -->\n\n",
  14. "translations": {
  15. "chinese": "## \u51fd\u6570\uff1a\n* [ABS()](../Functions/Mathematical_functions.md#ABS%28%29)\n* [ALL()](../Functions/Arrays_and_conditions_functions.md#ALL%28%29)\n* [ANY()](../Functions/Arrays_and_conditions_functions.md#ANY%28%29)\n* [ATAN2()](../Functions/Mathematical_functions.md#ATAN2%28%29)\n* [BIGINT()](../Functions/Type_casting_functions.md#BIGINT%28%29)\n* [BITDOT()](../Functions/Mathematical_functions.md#BITDOT%28%29)\n* [BM25F()](../Functions/Searching_and_ranking_functions.md#BM25F%28%29)\n* [CEIL()](../Functions/Mathematical_functions.md#CEIL%28%29)\n* [CONCAT()](../Functions/String_functions.md#CONCAT%28%29)\n* [CONTAINS()](../Functions/Arrays_and_conditions_functions.md#CONTAINS%28%29)\n* [COS()](../Functions/Mathematical_functions.md#COS%28%29)\n* [CRC32()](../Functions/Mathematical_functions.md#CRC32%28%29)\n* [DATE_HISTOGRAM()](../Functions/Date_and_time_functions.md#DATE_HISTOGRAM%28%29)\n* [DATE_RANGE()](../Functions/Date_and_time_functions.md#DATE_RANGE%28%29)\n* [DAY()](../Functions/Date_and_time_functions.md#DAY%28%29)\n* [DOUBLE()](../Functions/Type_casting_functions.md#DOUBLE%28%29)\n* [EXP()](../Functions/Mathematical_functions.md#EXP%28%29)\n* [FIBONACCI()](../Functions/Mathematical_functions.md#FIBONACCI%28%29)\n* [FLOOR()](../Functions/Mathematical_functions.md#FLOOR%28%29)\n* [GEODIST()](../Functions/Geo_spatial_functions.md#GEODIST%28%29)\n* [GEOPOLY2D()](../Functions/Geo_spatial_functions.md#GEOPOLY2D%28%29)\n* [GREATEST()](../Functions/Mathematical_functions.md#GREATEST%28%29)\n* [HOUR()](../Functions/Date_and_time_functions.md#HOUR%28%29)\n* [HISTOGRAM()](../Functions/Arrays_and_conditions_functions.md#HISTOGRAM%28%29)\n* [IDIV()](../Functions/Mathematical_functions.md#IDIV%28%29)\n* [IF()](../Functions/Arrays_and_conditions_functions.md#IF%28%29)\n* [IN()](../Functions/Arrays_and_conditions_functions.md#IN%28%29)\n* [INDEXOF()](../Functions/Arrays_and_conditions_functions.md#INDEXOF%28%29)\n* [INTEGER()](../Functions/Type_casting_functions.md#INTEGER%28%29)\n* [INTERVAL()](../Functions/Arrays_and_conditions_functions.md#INTERVAL%28%29)\n* [LAST_INSERT_ID()](../Functions/Other_functions.md#LAST_INSERT_ID%28%29)\n* [LEAST()](../Functions/Mathematical_functions.md#LEAST%28%29)\n* [LENGTH()](../Functions/Arrays_and_conditions_functions.md#LENGTH%28%29)\n* [LN()](../Functions/Mathematical_functions.md#LN%28%29)\n* [LOG10()](../Functions/Mathematical_functions.md#LOG10%28%29)\n* [LOG2()](../Functions/Mathematical_functions.md#LOG2%28%29)\n* [MAX()](../Functions/Mathematical_functions.md#MAX%28%29)\n* [MIN()](../Functions/Mathematical_functions.md#MIN%28%29)\n* [MINUTE()](../Functions/Date_and_time_functions.md#MINUTE%28%29)\n* [MIN_TOP_SORTVAL()](../Functions/Searching_and_ranking_functions.md#MIN_TOP_SORTVAL%28%29)\n* [MIN_TOP_WEIGHT()](../Functions/Searching_and_ranking_functions.md#MIN_TOP_WEIGHT%28%29)\n* [MONTH()](../Functions/Date_and_time_functions.md#MONTH%28%29)\n* [NOW()](../Functions/Date_and_time_functions.md#NOW%28%29)\n* [PACKEDFACTORS()](../Functions/Searching_and_ranking_functions.md#PACKEDFACTORS%28%29)\n* [POLY2D()](../Functions/Geo_spatial_functions.md#POLY2D%28%29)\n* [POW()](../Functions/Mathematical_functions.md#POW%28%29)\n* [RAND()](../Functions/Mathematical_functions.md#RAND%28%29)\n* [RANGE()](../Functions/Arrays_and_conditions_functions.md#RANGE%28%29)\n* [REGEX()](../Functions/String_functions.md#REGEX%28%29)\n* [REMAP()](../Functions/Arrays_and_conditions_functions.md#REMAP%28%29)\n* [SECOND()](../Functions/Date_and_time_functions.md#SECOND%28%29)\n* [SIN()](../Functions/Mathematical_functions.md#SIN%28%29)\n* [SINT()](../Functions/Type_casting_functions.md#SINT%28%29)\n* [SQRT()](../Functions/Mathematical_functions.md#SQRT%28%29)\n* [SUBSTRING_INDEX()](../Functions/String_functions.md#SUBSTRING_INDEX%28%29)\n* [TO_STRING()](../Functions/Type_casting_functions.md#TO_STRING%28%29)\n* [UINT()](../Functions/Type_casting_functions.md#UINT%28%29)\n* [YEAR()](../Functions/Date_and_time_functions.md#YEAR%28%29)\n* [YEARMONTH()](../Functions/Date_and_time_functions.md#YEARMONTH%28%29)\n* [YEARMONTHDAY()](../Functions/Date_and_time_functions.md#YEARMONTHDAY%28%29)\n* [WEIGHT()](../Functions/Searching_and_ranking_functions.md#WEIGHT%28%29)\n\n## HTTP JSON \u4e2d\u7684\u8868\u8fbe\u5f0f\n\n\u5728 HTTP JSON \u63a5\u53e3\u4e2d\uff0c\u901a\u8fc7 `script_fields` \u548c `expressions` \u652f\u6301\u8868\u8fbe\u5f0f\u3002\n\n### script_fields\n\n<!-- example script_fields -->\nCODE_BLOCK_4\n\n\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u521b\u5efa\u4e86\u4e24\u4e2a\u8868\u8fbe\u5f0f\uff1a`add_all` \u548c `title_len`\u3002\u7b2c\u4e00\u4e2a\u8868\u8fbe\u5f0f\u8ba1\u7b97 `( gid * 10 ) | crc32(title)` \u5e76\u5c06\u7ed3\u679c\u5b58\u50a8\u5728 `add_all` \u5c5e\u6027\u4e2d\u3002\u7b2c\u4e8c\u4e2a\u8868\u8fbe\u5f0f\u8ba1\u7b97 `crc32(title)` \u5e76\u5c06\u7ed3\u679c\u5b58\u50a8\u5728 `title_len` \u5c5e\u6027\u4e2d\u3002\n\n\u5f53\u524d\u4ec5\u652f\u6301 `inline` \u8868\u8fbe\u5f0f\u3002`inline` \u5c5e\u6027\u7684\u503c\uff08\u8981\u8ba1\u7b97\u7684\u8868\u8fbe\u5f0f\uff09\u5177\u6709\u4e0e SQL \u8868\u8fbe\u5f0f\u76f8\u540c\u7684\u8bed\u6cd5\u3002\n\n\u8868\u8fbe\u5f0f\u540d\u79f0\u53ef\u7528\u4e8e\u8fc7\u6ee4\u6216\u6392\u5e8f\u3002\n\n<!-- intro -->\n##### script_fields\uff1a\n\n<!-- request script_fields -->\nCODE_BLOCK_5\n\n<!-- end -->\n\n\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8868\u8fbe\u5f0f\u503c\u5305\u542b\u5728\u7ed3\u679c\u96c6\u7684 `_source` \u6570\u7ec4\u4e2d\u3002\u5982\u679c\u6e90\u662f\u9009\u62e9\u6027\u7684\uff08\u89c1[\u6e90\u9009\u62e9](../Searching/Search_results.md#Source-selection)\uff09\uff0c\u8868\u8fbe\u5f0f\u540d\u53ef\u4ee5\u6dfb\u52a0\u5230\u8bf7\u6c42\u4e2d\u7684 `_source` \u53c2\u6570\u4e2d\u3002\u6ce8\u610f\uff0c\u8868\u8fbe\u5f0f\u7684\u540d\u79f0\u5fc5\u987b\u662f\u5c0f\u5199\u3002\n\n### expressions\n\n<!-- example expressions -->\n\n`expressions` \u662f `script_fields` \u7684\u66ff\u4ee3\u65b9\u6848\uff0c\u5177\u6709\u66f4\u7b80\u6d01\u7684\u8bed\u6cd5\u3002\u793a\u4f8b\u8bf7\u6c42\u6dfb\u52a0\u4e86\u4e24\u4e2a\u8868\u8fbe\u5f0f\uff0c\u5e76\u5c06\u7ed3\u679c\u5b58\u50a8\u5230 `add_all` \u548c `title_len` \u5c5e\u6027\u4e2d\u3002\u6ce8\u610f\uff0c\u8868\u8fbe\u5f0f\u540d\u5fc5\u987b\u662f\u5c0f\u5199\u3002\n\n<!-- request expressions -->\nCODE_BLOCK_6\n\n<!-- end -->\n\n<!-- proofread -->",
  16. "russian": "## \u0424\u0443\u043d\u043a\u0446\u0438\u0438:\n* [ABS()](../Functions/Mathematical_functions.md#ABS%28%29)\n* [ALL()](../Functions/Arrays_and_conditions_functions.md#ALL%28%29)\n* [ANY()](../Functions/Arrays_and_conditions_functions.md#ANY%28%29)\n* [ATAN2()](../Functions/Mathematical_functions.md#ATAN2%28%29)\n* [BIGINT()](../Functions/Type_casting_functions.md#BIGINT%28%29)\n* [BITDOT()](../Functions/Mathematical_functions.md#BITDOT%28%29)\n* [BM25F()](../Functions/Searching_and_ranking_functions.md#BM25F%28%29)\n* [CEIL()](../Functions/Mathematical_functions.md#CEIL%28%29)\n* [CONCAT()](../Functions/String_functions.md#CONCAT%28%29)\n* [CONTAINS()](../Functions/Arrays_and_conditions_functions.md#CONTAINS%28%29)\n* [COS()](../Functions/Mathematical_functions.md#COS%28%29)\n* [CRC32()](../Functions/Mathematical_functions.md#CRC32%28%29)\n* [DATE_HISTOGRAM()](../Functions/Date_and_time_functions.md#DATE_HISTOGRAM%28%29)\n* [DATE_RANGE()](../Functions/Date_and_time_functions.md#DATE_RANGE%28%29)\n* [DAY()](../Functions/Date_and_time_functions.md#DAY%28%29)\n* [DOUBLE()](../Functions/Type_casting_functions.md#DOUBLE%28%29)\n* [EXP()](../Functions/Mathematical_functions.md#EXP%28%29)\n* [FIBONACCI()](../Functions/Mathematical_functions.md#FIBONACCI%28%29)\n* [FLOOR()](../Functions/Mathematical_functions.md#FLOOR%28%29)\n* [GEODIST()](../Functions/Geo_spatial_functions.md#GEODIST%28%29)\n* [GEOPOLY2D()](../Functions/Geo_spatial_functions.md#GEOPOLY2D%28%29)\n* [GREATEST()](../Functions/Mathematical_functions.md#GREATEST%28%29)\n* [HOUR()](../Functions/Date_and_time_functions.md#HOUR%28%29)\n* [HISTOGRAM()](../Functions/Arrays_and_conditions_functions.md#HISTOGRAM%28%29)\n* [IDIV()](../Functions/Mathematical_functions.md#IDIV%28%29)\n* [IF()](../Functions/Arrays_and_conditions_functions.md#IF%28%29)\n* [IN()](../Functions/Arrays_and_conditions_functions.md#IN%28%29)\n* [INDEXOF()](../Functions/Arrays_and_conditions_functions.md#INDEXOF%28%29)\n* [INTEGER()](../Functions/Type_casting_functions.md#INTEGER%28%29)\n* [INTERVAL()](../Functions/Arrays_and_conditions_functions.md#INTERVAL%28%29)\n* [LAST_INSERT_ID()](../Functions/Other_functions.md#LAST_INSERT_ID%28%29)\n* [LEAST()](../Functions/Mathematical_functions.md#LEAST%28%29)\n* [LENGTH()](../Functions/Arrays_and_conditions_functions.md#LENGTH%28%29)\n* [LN()](../Functions/Mathematical_functions.md#LN%28%29)\n* [LOG10()](../Functions/Mathematical_functions.md#LOG10%28%29)\n* [LOG2()](../Functions/Mathematical_functions.md#LOG2%28%29)\n* [MAX()](../Functions/Mathematical_functions.md#MAX%28%29)\n* [MIN()](../Functions/Mathematical_functions.md#MIN%28%29)\n* [MINUTE()](../Functions/Date_and_time_functions.md#MINUTE%28%29)\n* [MIN_TOP_SORTVAL()](../Functions/Searching_and_ranking_functions.md#MIN_TOP_SORTVAL%28%29)\n* [MIN_TOP_WEIGHT()](../Functions/Searching_and_ranking_functions.md#MIN_TOP_WEIGHT%28%29)\n* [MONTH()](../Functions/Date_and_time_functions.md#MONTH%28%29)\n* [NOW()](../Functions/Date_and_time_functions.md#NOW%28%29)\n* [PACKEDFACTORS()](../Functions/Searching_and_ranking_functions.md#PACKEDFACTORS%28%29)\n* [POLY2D()](../Functions/Geo_spatial_functions.md#POLY2D%28%29)\n* [POW()](../Functions/Mathematical_functions.md#POW%28%29)\n* [RAND()](../Functions/Mathematical_functions.md#RAND%28%29)\n* [RANGE()](../Functions/Arrays_and_conditions_functions.md#RANGE%28%29)\n* [REGEX()](../Functions/String_functions.md#REGEX%28%29)\n* [REMAP()](../Functions/Arrays_and_conditions_functions.md#REMAP%28%29)\n* [SECOND()](../Functions/Date_and_time_functions.md#SECOND%28%29)\n* [SIN()](../Functions/Mathematical_functions.md#SIN%28%29)\n* [SINT()](../Functions/Type_casting_functions.md#SINT%28%29)\n* [SQRT()](../Functions/Mathematical_functions.md#SQRT%28%29)\n* [SUBSTRING_INDEX()](../Functions/String_functions.md#SUBSTRING_INDEX%28%29)\n* [TO_STRING()](../Functions/Type_casting_functions.md#TO_STRING%28%29)\n* [UINT()](../Functions/Type_casting_functions.md#UINT%28%29)\n* [YEAR()](../Functions/Date_and_time_functions.md#YEAR%28%29)\n* [YEARMONTH()](../Functions/Date_and_time_functions.md#YEARMONTH%28%29)\n* [YEARMONTHDAY()](../Functions/Date_and_time_functions.md#YEARMONTHDAY%28%29)\n* [WEIGHT()](../Functions/Searching_and_ranking_functions.md#WEIGHT%28%29)\n\n## \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 HTTP JSON\n\n\u0412 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 HTTP JSON \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0447\u0435\u0440\u0435\u0437 `script_fields` \u0438 `expressions`.\n\n### script_fields\n\n<!-- example script_fields -->\nCODE_BLOCK_4\n\n\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f: `add_all` \u0438 `title_len`. \u041f\u0435\u0440\u0432\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 `( gid * 10 ) | crc32(title)` \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 `add_all`. \u0412\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 `crc32(title)` \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 `title_len`.\n\n\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e `inline` \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 `inline` (\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f) \u0438\u043c\u0435\u0435\u0442 \u0442\u0430\u043a\u043e\u0439 \u0436\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u043a\u0430\u043a \u0438 SQL \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f.\n\n\u0418\u043c\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u0440\u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0435.\n\n<!-- intro -->\n##### script_fields:\n\n<!-- request script_fields -->\nCODE_BLOCK_5\n\n<!-- end -->\n\n\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 `_source` \u043d\u0430\u0431\u043e\u0440\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432. \u0415\u0441\u043b\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u0439 (\u0441\u043c. [\u0412\u044b\u0431\u043e\u0440 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430](../Searching/Search_results.md#Source-selection)), \u0438\u043c\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 `_source` \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432 \u043d\u0438\u0436\u043d\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435.\n\n### expressions\n\n<!-- example expressions -->\n\n`expressions` \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043e\u0439 `script_fields` \u0441 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c. \u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0432\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445 `add_all` \u0438 `title_len`. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u0438\u043c\u0435\u043d\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432 \u043d\u0438\u0436\u043d\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435.\n\n<!-- request expressions -->\nCODE_BLOCK_6\n\n<!-- end -->\n\n<!-- proofread -->"
  17. },
  18. "is_code_or_comment": false,
  19. "model": "openai:gpt-4.1-mini",
  20. "updated_at": 1766339825
  21. },
  22. "bb7591ac56006e7cd612903069a1f87eb2f2b7d669736d0c48a0e721b3ef226c": {
  23. "original": "## Functions:\n* [ABS()](../Functions/Mathematical_functions.md#ABS%28%29)\n* [ALL()](../Functions/Arrays_and_conditions_functions.md#ALL%28%29)\n* [ANY()](../Functions/Arrays_and_conditions_functions.md#ANY%28%29)\n* [ATAN2()](../Functions/Mathematical_functions.md#ATAN2%28%29)\n* [BIGINT()](../Functions/Type_casting_functions.md#BIGINT%28%29)\n* [BITDOT()](../Functions/Mathematical_functions.md#BITDOT%28%29)\n* [BM25F()](../Functions/Searching_and_ranking_functions.md#BM25F%28%29)\n* [CEIL()](../Functions/Mathematical_functions.md#CEIL%28%29)\n* [CONCAT()](../Functions/String_functions.md#CONCAT%28%29)\n* [CONTAINS()](../Functions/Arrays_and_conditions_functions.md#CONTAINS%28%29)\n* [COS()](../Functions/Mathematical_functions.md#COS%28%29)\n* [CRC32()](../Functions/Mathematical_functions.md#CRC32%28%29)\n* [DATE_HISTOGRAM()](../Functions/Date_and_time_functions.md#DATE_HISTOGRAM%28%29)\n* [DATE_RANGE()](../Functions/Date_and_time_functions.md#DATE_RANGE%28%29)\n* [DAY()](../Functions/Date_and_time_functions.md#DAY%28%29)\n* [DOUBLE()](../Functions/Type_casting_functions.md#DOUBLE%28%29)\n* [EXP()](../Functions/Mathematical_functions.md#EXP%28%29)\n* [FIBONACCI()](../Functions/Mathematical_functions.md#FIBONACCI%28%29)\n* [FLOOR()](../Functions/Mathematical_functions.md#FLOOR%28%29)\n* [GEODIST()](../Functions/Geo_spatial_functions.md#GEODIST%28%29)\n* [GEOPOLY2D()](../Functions/Geo_spatial_functions.md#GEOPOLY2D%28%29)\n* [GREATEST()](../Functions/Mathematical_functions.md#GREATEST%28%29)\n* [HOUR()](../Functions/Date_and_time_functions.md#HOUR%28%29)\n* [HISTOGRAM()](../Functions/Arrays_and_conditions_functions.md#HISTOGRAM%28%29)\n* [IDIV()](../Functions/Mathematical_functions.md#IDIV%28%29)\n* [IF()](../Functions/Arrays_and_conditions_functions.md#IF%28%29)\n* [IN()](../Functions/Arrays_and_conditions_functions.md#IN%28%29)\n* [INDEXOF()](../Functions/Arrays_and_conditions_functions.md#INDEXOF%28%29)\n* [INTEGER()](../Functions/Type_casting_functions.md#INTEGER%28%29)\n* [INTERVAL()](../Functions/Arrays_and_conditions_functions.md#INTERVAL%28%29)\n* [LAST_INSERT_ID()](../Functions/Other_functions.md#LAST_INSERT_ID%28%29)\n* [LEAST()](../Functions/Mathematical_functions.md#LEAST%28%29)\n* [LENGTH()](../Functions/Arrays_and_conditions_functions.md#LENGTH%28%29)\n* [LN()](../Functions/Mathematical_functions.md#LN%28%29)\n* [LOG10()](../Functions/Mathematical_functions.md#LOG10%28%29)\n* [LOG2()](../Functions/Mathematical_functions.md#LOG2%28%29)\n* [MAX()](../Functions/Mathematical_functions.md#MAX%28%29)\n* [MIN()](../Functions/Mathematical_functions.md#MIN%28%29)\n* [MINUTE()](../Functions/Date_and_time_functions.md#MINUTE%28%29)\n* [MIN_TOP_SORTVAL()](../Functions/Searching_and_ranking_functions.md#MIN_TOP_SORTVAL%28%29)\n* [MIN_TOP_WEIGHT()](../Functions/Searching_and_ranking_functions.md#MIN_TOP_WEIGHT%28%29)\n* [MONTH()](../Functions/Date_and_time_functions.md#MONTH%28%29)\n* [NOW()](../Functions/Date_and_time_functions.md#NOW%28%29)\n* [PACKEDFACTORS()](../Functions/Searching_and_ranking_functions.md#PACKEDFACTORS%28%29)\n* [POLY2D()](../Functions/Geo_spatial_functions.md#POLY2D%28%29)\n* [POW()](../Functions/Mathematical_functions.md#POW%28%29)\n* [RAND()](../Functions/Mathematical_functions.md#RAND%28%29)\n* [RANGE()](../Functions/Arrays_and_conditions_functions.md#RANGE%28%29)\n* [REGEX()](../Functions/String_functions.md#REGEX%28%29)\n* [REMAP()](../Functions/Arrays_and_conditions_functions.md#REMAP%28%29)\n* [SECOND()](../Functions/Date_and_time_functions.md#SECOND%28%29)\n* [SIN()](../Functions/Mathematical_functions.md#SIN%28%29)\n* [SINT()](../Functions/Type_casting_functions.md#SINT%28%29)\n* [SQRT()](../Functions/Mathematical_functions.md#SQRT%28%29)\n* [SUBSTRING_INDEX()](../Functions/String_functions.md#SUBSTRING_INDEX%28%29)\n* [TO_STRING()](../Functions/Type_casting_functions.md#TO_STRING%28%29)\n* [UINT()](../Functions/Type_casting_functions.md#UINT%28%29)\n* [YEAR()](../Functions/Date_and_time_functions.md#YEAR%28%29)\n* [YEARMONTH()](../Functions/Date_and_time_functions.md#YEARMONTH%28%29)\n* [YEARMONTHDAY()](../Functions/Date_and_time_functions.md#YEARMONTHDAY%28%29)\n* [WEIGHT()](../Functions/Searching_and_ranking_functions.md#WEIGHT%28%29)\n\n## Expressions in HTTP JSON\n\nIn the HTTP JSON interface, expressions are supported via `script_fields` and `expressions`.\n\n### script_fields\n\n<!-- example script_fields -->\nCODE_BLOCK_4\n\nIn this example, two expressions are created: `add_all` and `title_len`. The first expression calculates `( gid * 10 ) | crc32(title)` and stores the result in the `add_all` attribute. The second expression calculates `crc32(title)` and stores the result in the `title_len` attribute.\n\nCurrently, only `inline` expressions are supported. The value of the `inline` property (the expression to compute) has the same syntax as SQL expressions.\n\nThe expression name can be utilized in filtering or sorting.\n\n<!-- intro -->\n##### script_fields:\n\n<!-- request script_fields -->\nCODE_BLOCK_5\n\n<!-- end -->\n\nBy default, expression values are included in the `_source` array of the result set. If the source is selective (see [Source selection](../Searching/Search_results.md#Source-selection)), the expression name can be added to the `_source` parameter in the request. Note, the names of the expressions must be in lowercase.\n\n### expressions\n\n<!-- example expressions -->\n\n`expressions` is an alternative to `script_fields` with a simpler syntax. The example request adds two expressions and stores the results into `add_all` and `title_len` attributes. Note, the names of the expressions must be in lowercase.\n\n<!-- request expressions -->\nCODE_BLOCK_6\n\n<!-- end -->\n\n<!-- proofread -->\n\n",
  24. "translations": {
  25. "chinese": "## \u51fd\u6570\uff1a\n* [ABS()](../Functions/Mathematical_functions.md#ABS%28%29)\n* [ALL()](../Functions/Arrays_and_conditions_functions.md#ALL%28%29)\n* [ANY()](../Functions/Arrays_and_conditions_functions.md#ANY%28%29)\n* [ATAN2()](../Functions/Mathematical_functions.md#ATAN2%28%29)\n* [BIGINT()](../Functions/Type_casting_functions.md#BIGINT%28%29)\n* [BITDOT()](../Functions/Mathematical_functions.md#BITDOT%28%29)\n* [BM25F()](../Functions/Searching_and_ranking_functions.md#BM25F%28%29)\n* [CEIL()](../Functions/Mathematical_functions.md#CEIL%28%29)\n* [CONCAT()](../Functions/String_functions.md#CONCAT%28%29)\n* [CONTAINS()](../Functions/Arrays_and_conditions_functions.md#CONTAINS%28%29)\n* [COS()](../Functions/Mathematical_functions.md#COS%28%29)\n* [CRC32()](../Functions/Mathematical_functions.md#CRC32%28%29)\n* [DATE_HISTOGRAM()](../Functions/Date_and_time_functions.md#DATE_HISTOGRAM%28%29)\n* [DATE_RANGE()](../Functions/Date_and_time_functions.md#DATE_RANGE%28%29)\n* [DAY()](../Functions/Date_and_time_functions.md#DAY%28%29)\n* [DOUBLE()](../Functions/Type_casting_functions.md#DOUBLE%28%29)\n* [EXP()](../Functions/Mathematical_functions.md#EXP%28%29)\n* [FIBONACCI()](../Functions/Mathematical_functions.md#FIBONACCI%28%29)\n* [FLOOR()](../Functions/Mathematical_functions.md#FLOOR%28%29)\n* [GEODIST()](../Functions/Geo_spatial_functions.md#GEODIST%28%29)\n* [GEOPOLY2D()](../Functions/Geo_spatial_functions.md#GEOPOLY2D%28%29)\n* [GREATEST()](../Functions/Mathematical_functions.md#GREATEST%28%29)\n* [HOUR()](../Functions/Date_and_time_functions.md#HOUR%28%29)\n* [HISTOGRAM()](../Functions/Arrays_and_conditions_functions.md#HISTOGRAM%28%29)\n* [IDIV()](../Functions/Mathematical_functions.md#IDIV%28%29)\n* [IF()](../Functions/Arrays_and_conditions_functions.md#IF%28%29)\n* [IN()](../Functions/Arrays_and_conditions_functions.md#IN%28%29)\n* [INDEXOF()](../Functions/Arrays_and_conditions_functions.md#INDEXOF%28%29)\n* [INTEGER()](../Functions/Type_casting_functions.md#INTEGER%28%29)\n* [INTERVAL()](../Functions/Arrays_and_conditions_functions.md#INTERVAL%28%29)\n* [LAST_INSERT_ID()](../Functions/Other_functions.md#LAST_INSERT_ID%28%29)\n* [LEAST()](../Functions/Mathematical_functions.md#LEAST%28%29)\n* [LENGTH()](../Functions/Arrays_and_conditions_functions.md#LENGTH%28%29)\n* [LN()](../Functions/Mathematical_functions.md#LN%28%29)\n* [LOG10()](../Functions/Mathematical_functions.md#LOG10%28%29)\n* [LOG2()](../Functions/Mathematical_functions.md#LOG2%28%29)\n* [MAX()](../Functions/Mathematical_functions.md#MAX%28%29)\n* [MIN()](../Functions/Mathematical_functions.md#MIN%28%29)\n* [MINUTE()](../Functions/Date_and_time_functions.md#MINUTE%28%29)\n* [MIN_TOP_SORTVAL()](../Functions/Searching_and_ranking_functions.md#MIN_TOP_SORTVAL%28%29)\n* [MIN_TOP_WEIGHT()](../Functions/Searching_and_ranking_functions.md#MIN_TOP_WEIGHT%28%29)\n* [MONTH()](../Functions/Date_and_time_functions.md#MONTH%28%29)\n* [NOW()](../Functions/Date_and_time_functions.md#NOW%28%29)\n* [PACKEDFACTORS()](../Functions/Searching_and_ranking_functions.md#PACKEDFACTORS%28%29)\n* [POLY2D()](../Functions/Geo_spatial_functions.md#POLY2D%28%29)\n* [POW()](../Functions/Mathematical_functions.md#POW%28%29)\n* [RAND()](../Functions/Mathematical_functions.md#RAND%28%29)\n* [RANGE()](../Functions/Arrays_and_conditions_functions.md#RANGE%28%29)\n* [REGEX()](../Functions/String_functions.md#REGEX%28%29)\n* [REMAP()](../Functions/Arrays_and_conditions_functions.md#REMAP%28%29)\n* [SECOND()](../Functions/Date_and_time_functions.md#SECOND%28%29)\n* [SIN()](../Functions/Mathematical_functions.md#SIN%28%29)\n* [SINT()](../Functions/Type_casting_functions.md#SINT%28%29)\n* [SQRT()](../Functions/Mathematical_functions.md#SQRT%28%29)\n* [SUBSTRING_INDEX()](../Functions/String_functions.md#SUBSTRING_INDEX%28%29)\n* [TO_STRING()](../Functions/Type_casting_functions.md#TO_STRING%28%29)\n* [UINT()](../Functions/Type_casting_functions.md#UINT%28%29)\n* [YEAR()](../Functions/Date_and_time_functions.md#YEAR%28%29)\n* [YEARMONTH()](../Functions/Date_and_time_functions.md#YEARMONTH%28%29)\n* [YEARMONTHDAY()](../Functions/Date_and_time_functions.md#YEARMONTHDAY%28%29)\n* [WEIGHT()](../Functions/Searching_and_ranking_functions.md#WEIGHT%28%29)\n\n## HTTP JSON \u4e2d\u7684\u8868\u8fbe\u5f0f\n\n\u5728 HTTP JSON \u63a5\u53e3\u4e2d\uff0c\u901a\u8fc7 `script_fields` \u548c `expressions` \u652f\u6301\u8868\u8fbe\u5f0f\u3002\n\n### script_fields\n\n<!-- example script_fields -->\nCODE_BLOCK_4\n\n\u5728\u8fd9\u4e2a\u793a\u4f8b\u4e2d\uff0c\u521b\u5efa\u4e86\u4e24\u4e2a\u8868\u8fbe\u5f0f\uff1a`add_all` \u548c `title_len`\u3002\u7b2c\u4e00\u4e2a\u8868\u8fbe\u5f0f\u8ba1\u7b97 `( gid * 10 ) | crc32(title)` \u5e76\u5c06\u7ed3\u679c\u5b58\u50a8\u5728 `add_all` \u5c5e\u6027\u4e2d\u3002\u7b2c\u4e8c\u4e2a\u8868\u8fbe\u5f0f\u8ba1\u7b97 `crc32(title)` \u5e76\u5c06\u7ed3\u679c\u5b58\u50a8\u5728 `title_len` \u5c5e\u6027\u4e2d\u3002\n\n\u76ee\u524d\uff0c\u4ec5\u652f\u6301 `inline` \u8868\u8fbe\u5f0f\u3002`inline` \u5c5e\u6027\uff08\u8981\u8ba1\u7b97\u7684\u8868\u8fbe\u5f0f\uff09\u7684\u503c\u5177\u6709\u4e0e SQL \u8868\u8fbe\u5f0f\u76f8\u540c\u7684\u8bed\u6cd5\u3002\n\n\u8868\u8fbe\u5f0f\u540d\u79f0\u53ef\u4ee5\u5728\u8fc7\u6ee4\u6216\u6392\u5e8f\u4e2d\u4f7f\u7528\u3002\n\n<!-- intro -->\n##### script_fields\uff1a\n\n<!-- request script_fields -->\nCODE_BLOCK_5\n\n<!-- end -->\n\n\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u8868\u8fbe\u5f0f\u503c\u5305\u542b\u5728\u7ed3\u679c\u96c6\u7684 `_source` \u6570\u7ec4\u4e2d\u3002\u5982\u679c\u6e90\u662f\u9009\u62e9\u6027\u7684\uff08\u53c2\u89c1 [\u6e90\u9009\u62e9](../Searching/Search_results.md#Source-selection)\uff09\uff0c\u53ef\u4ee5\u5728\u8bf7\u6c42\u4e2d\u5c06\u8868\u8fbe\u5f0f\u540d\u79f0\u6dfb\u52a0\u5230 `_source` \u53c2\u6570\u4e2d\u3002\u6ce8\u610f\uff0c\u8868\u8fbe\u5f0f\u7684\u540d\u79f0\u5fc5\u987b\u662f\u5c0f\u5199\u7684\u3002\n\n### expressions\n\n<!-- example expressions -->\n\n`expressions` \u662f `script_fields` \u7684\u66ff\u4ee3\u65b9\u6848\uff0c\u8bed\u6cd5\u66f4\u7b80\u5355\u3002\u793a\u4f8b\u8bf7\u6c42\u6dfb\u52a0\u4e86\u4e24\u4e2a\u8868\u8fbe\u5f0f\u5e76\u5c06\u7ed3\u679c\u5b58\u50a8\u5728 `add_all` \u548c `title_len` \u5c5e\u6027\u4e2d\u3002\u6ce8\u610f\uff0c\u8868\u8fbe\u5f0f\u7684\u540d\u79f0\u5fc5\u987b\u662f\u5c0f\u5199\u7684\u3002\n\n<!-- request expressions -->\nCODE_BLOCK_6\n\n<!-- end -->\n\n<!-- proofread -->",
  26. "russian": "## \u0424\u0443\u043d\u043a\u0446\u0438\u0438:\n* [ABS()](../Functions/Mathematical_functions.md#ABS%28%29)\n* [ALL()](../Functions/Arrays_and_conditions_functions.md#ALL%28%29)\n* [ANY()](../Functions/Arrays_and_conditions_functions.md#ANY%28%29)\n* [ATAN2()](../Functions/Mathematical_functions.md#ATAN2%28%29)\n* [BIGINT()](../Functions/Type_casting_functions.md#BIGINT%28%29)\n* [BITDOT()](../Functions/Mathematical_functions.md#BITDOT%28%29)\n* [BM25F()](../Functions/Searching_and_ranking_functions.md#BM25F%28%29)\n* [CEIL()](../Functions/Mathematical_functions.md#CEIL%28%29)\n* [CONCAT()](../Functions/String_functions.md#CONCAT%28%29)\n* [CONTAINS()](../Functions/Arrays_and_conditions_functions.md#CONTAINS%28%29)\n* [COS()](../Functions/Mathematical_functions.md#COS%28%29)\n* [CRC32()](../Functions/Mathematical_functions.md#CRC32%28%29)\n* [DATE_HISTOGRAM()](../Functions/Date_and_time_functions.md#DATE_HISTOGRAM%28%29)\n* [DATE_RANGE()](../Functions/Date_and_time_functions.md#DATE_RANGE%28%29)\n* [DAY()](../Functions/Date_and_time_functions.md#DAY%28%29)\n* [DOUBLE()](../Functions/Type_casting_functions.md#DOUBLE%28%29)\n* [EXP()](../Functions/Mathematical_functions.md#EXP%28%29)\n* [FIBONACCI()](../Functions/Mathematical_functions.md#FIBONACCI%28%29)\n* [FLOOR()](../Functions/Mathematical_functions.md#FLOOR%28%29)\n* [GEODIST()](../Functions/Geo_spatial_functions.md#GEODIST%28%29)\n* [GEOPOLY2D()](../Functions/Geo_spatial_functions.md#GEOPOLY2D%28%29)\n* [GREATEST()](../Functions/Mathematical_functions.md#GREATEST%28%29)\n* [HOUR()](../Functions/Date_and_time_functions.md#HOUR%28%29)\n* [HISTOGRAM()](../Functions/Arrays_and_conditions_functions.md#HISTOGRAM%28%29)\n* [IDIV()](../Functions/Mathematical_functions.md#IDIV%28%29)\n* [IF()](../Functions/Arrays_and_conditions_functions.md#IF%28%29)\n* [IN()](../Functions/Arrays_and_conditions_functions.md#IN%28%29)\n* [INDEXOF()](../Functions/Arrays_and_conditions_functions.md#INDEXOF%28%29)\n* [INTEGER()](../Functions/Type_casting_functions.md#INTEGER%28%29)\n* [INTERVAL()](../Functions/Arrays_and_conditions_functions.md#INTERVAL%28%29)\n* [LAST_INSERT_ID()](../Functions/Other_functions.md#LAST_INSERT_ID%28%29)\n* [LEAST()](../Functions/Mathematical_functions.md#LEAST%28%29)\n* [LENGTH()](../Functions/Arrays_and_conditions_functions.md#LENGTH%28%29)\n* [LN()](../Functions/Mathematical_functions.md#LN%28%29)\n* [LOG10()](../Functions/Mathematical_functions.md#LOG10%28%29)\n* [LOG2()](../Functions/Mathematical_functions.md#LOG2%28%29)\n* [MAX()](../Functions/Mathematical_functions.md#MAX%28%29)\n* [MIN()](../Functions/Mathematical_functions.md#MIN%28%29)\n* [MINUTE()](../Functions/Date_and_time_functions.md#MINUTE%28%29)\n* [MIN_TOP_SORTVAL()](../Functions/Searching_and_ranking_functions.md#MIN_TOP_SORTVAL%28%29)\n* [MIN_TOP_WEIGHT()](../Functions/Searching_and_ranking_functions.md#MIN_TOP_WEIGHT%28%29)\n* [MONTH()](../Functions/Date_and_time_functions.md#MONTH%28%29)\n* [NOW()](../Functions/Date_and_time_functions.md#NOW%28%29)\n* [PACKEDFACTORS()](../Functions/Searching_and_ranking_functions.md#PACKEDFACTORS%28%29)\n* [POLY2D()](../Functions/Geo_spatial_functions.md#POLY2D%28%29)\n* [POW()](../Functions/Mathematical_functions.md#POW%28%29)\n* [RAND()](../Functions/Mathematical_functions.md#RAND%28%29)\n* [RANGE()](../Functions/Arrays_and_conditions_functions.md#RANGE%28%29)\n* [REGEX()](../Functions/String_functions.md#REGEX%28%29)\n* [REMAP()](../Functions/Arrays_and_conditions_functions.md#REMAP%28%29)\n* [SECOND()](../Functions/Date_and_time_functions.md#SECOND%28%29)\n* [SIN()](../Functions/Mathematical_functions.md#SIN%28%29)\n* [SINT()](../Functions/Type_casting_functions.md#SINT%28%29)\n* [SQRT()](../Functions/Mathematical_functions.md#SQRT%28%29)\n* [SUBSTRING_INDEX()](../Functions/String_functions.md#SUBSTRING_INDEX%28%29)\n* [TO_STRING()](../Functions/Type_casting_functions.md#TO_STRING%28%29)\n* [UINT()](../Functions/Type_casting_functions.md#UINT%28%29)\n* [YEAR()](../Functions/Date_and_time_functions.md#YEAR%28%29)\n* [YEARMONTH()](../Functions/Date_and_time_functions.md#YEARMONTH%28%29)\n* [YEARMONTHDAY()](../Functions/Date_and_time_functions.md#YEARMONTHDAY%28%29)\n* [WEIGHT()](../Functions/Searching_and_ranking_functions.md#WEIGHT%28%29)\n\n## \u0412\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0432 HTTP JSON\n\n\u0412 HTTP JSON \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 `script_fields` \u0438 `expressions`.\n\n### script_fields\n\n<!-- example script_fields -->\nCODE_BLOCK_4\n\n\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441\u043e\u0437\u0434\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f: `add_all` \u0438 `title_len`. \u041f\u0435\u0440\u0432\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 `( gid * 10 ) | crc32(title)` \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 `add_all`. \u0412\u0442\u043e\u0440\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442 `crc32(title)` \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 `title_len`.\n\n\u0412 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e `inline` \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 `inline` (\u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c\u043e\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435) \u0438\u043c\u0435\u0435\u0442 \u0442\u043e\u0442 \u0436\u0435 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u0447\u0442\u043e \u0438 SQL \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f.\n\n\u0418\u043c\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0434\u043b\u044f \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0438\u043b\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438.\n\n<!-- intro -->\n##### script_fields:\n\n<!-- request script_fields -->\nCODE_BLOCK_5\n\n<!-- end -->\n\n\u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0432\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 `_source` \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0433\u043e \u043d\u0430\u0431\u043e\u0440\u0430. \u0415\u0441\u043b\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0432\u044b\u0431\u043e\u0440\u043e\u0447\u043d\u044b\u0439 (\u0441\u043c. [\u0412\u044b\u0431\u043e\u0440 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430](../Searching/Search_results.md#Source-selection)), \u0438\u043c\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u0432 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 `_source` \u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0435. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0438\u043c\u0435\u043d\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432 \u043d\u0438\u0436\u043d\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435.\n\n### expressions\n\n<!-- example expressions -->\n\n`expressions` \u2014 \u044d\u0442\u043e \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u0430 `script_fields` \u0441 \u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u043e\u043c. \u041f\u0440\u0438\u043c\u0435\u0440 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0434\u0432\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b `add_all` \u0438 `title_len`. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0438\u043c\u0435\u043d\u0430 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0432 \u043d\u0438\u0436\u043d\u0435\u043c \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0435.\n\n<!-- request expressions -->\nCODE_BLOCK_6\n\n<!-- end -->\n\n<!-- proofread -->"
  27. },
  28. "is_code_or_comment": false,
  29. "model": "deepseek/deepseek-v3.2",
  30. "updated_at": 1766374216
  31. },
  32. "__meta": {
  33. "source_text": "# Expressions in search\n\nManticore enables the use of arbitrary arithmetic expressions through both SQL and HTTP, incorporating attribute values, internal attributes (document ID and relevance weight), arithmetic operations, several built-in functions, and user-defined functions. Below is the complete reference list for quick access.\n\n## Arithmetic operators\n```sql\n+, -, *, /, %, DIV, MOD\n```\n\nStandard arithmetic operators are available. Arithmetic calculations involving these operators can be executed in three different modes:\n\n1. using single-precision, 32-bit IEEE 754 floating point values (default),\n2. using signed 32-bit integers,\n3. using 64-bit signed integers.\n\nThe expression parser automatically switches to integer mode if no operations result in a floating point value. Otherwise, it uses the default floating point mode. For example, a+b will be computed using 32-bit integers if both arguments are 32-bit integers; or using 64-bit integers if both arguments are integers but one of them is 64-bit; or in floats otherwise. However, `a/b` or `sqrt(a)` will always be computed in floats, as these operations return a non-integer result. To avoid this, you can use `IDIV(a,b)` or a `DIV b` form. Additionally, `a*b` will not automatically promote to 64-bit when arguments are 32-bit. To enforce 64-bit results, use [BIGINT()](../Functions/Type_casting_functions.md#BIGINT%28%29), but note that if non-integer operations are present, BIGINT() will simply be ignored.\n\n## Comparison operators\n```sql\n<, > <=, >=, =, <>\n```\n\nThe comparison operators return 1.0 when the condition is true and 0.0 otherwise. For example, `(a=b)+3` evaluates to 4 when attribute `a` is equal to attribute `b`, and to 3 when `a` is not. Unlike MySQL, the equality comparisons (i.e., `=` and `<>` operators) include a small equality threshold (1e-6 by default). If the difference between the compared values is within the threshold, they are considered equal.\n\nThe `BETWEEN` and `IN` operators, in the case of multi-value attributes, return true if at least one value matches the condition (similar to [ANY()](../Functions/Arrays_and_conditions_functions.md#ANY%28%29)). The `IN` operator does not support JSON attributes. The `IS (NOT) NULL` operator is supported only for JSON attributes.\n\n## Boolean operators\n```sql\nAND, OR, NOT\n```\n\nBoolean operators (AND, OR, NOT) behave as expected. They are left-associative and have the lowest priority compared to other operators. NOT has higher priority than AND and OR but still less than any other operator. AND and OR share the same priority, so using parentheses is recommended to avoid confusion in complex expressions.\n\n## Bitwise operators\n```sql\n&, |\n```\n\nThese operators perform bitwise AND and OR respectively. The operands must be of integer types.\n\n## Functions:\n* [ABS()](../Functions/Mathematical_functions.md#ABS%28%29)\n* [ALL()](../Functions/Arrays_and_conditions_functions.md#ALL%28%29)\n* [ANY()](../Functions/Arrays_and_conditions_functions.md#ANY%28%29)\n* [ATAN2()](../Functions/Mathematical_functions.md#ATAN2%28%29)\n* [BIGINT()](../Functions/Type_casting_functions.md#BIGINT%28%29)\n* [BITDOT()](../Functions/Mathematical_functions.md#BITDOT%28%29)\n* [BM25F()](../Functions/Searching_and_ranking_functions.md#BM25F%28%29)\n* [CEIL()](../Functions/Mathematical_functions.md#CEIL%28%29)\n* [CONCAT()](../Functions/String_functions.md#CONCAT%28%29)\n* [CONTAINS()](../Functions/Arrays_and_conditions_functions.md#CONTAINS%28%29)\n* [COS()](../Functions/Mathematical_functions.md#COS%28%29)\n* [CRC32()](../Functions/Mathematical_functions.md#CRC32%28%29)\n* [DATE_HISTOGRAM()](../Functions/Date_and_time_functions.md#DATE_HISTOGRAM%28%29)\n* [DATE_RANGE()](../Functions/Date_and_time_functions.md#DATE_RANGE%28%29)\n* [DAY()](../Functions/Date_and_time_functions.md#DAY%28%29)\n* [DOUBLE()](../Functions/Type_casting_functions.md#DOUBLE%28%29)\n* [EXP()](../Functions/Mathematical_functions.md#EXP%28%29)\n* [FIBONACCI()](../Functions/Mathematical_functions.md#FIBONACCI%28%29)\n* [FLOOR()](../Functions/Mathematical_functions.md#FLOOR%28%29)\n* [GEODIST()](../Functions/Geo_spatial_functions.md#GEODIST%28%29)\n* [GEOPOLY2D()](../Functions/Geo_spatial_functions.md#GEOPOLY2D%28%29)\n* [GREATEST()](../Functions/Mathematical_functions.md#GREATEST%28%29)\n* [HOUR()](../Functions/Date_and_time_functions.md#HOUR%28%29)\n* [HISTOGRAM()](../Functions/Arrays_and_conditions_functions.md#HISTOGRAM%28%29)\n* [IDIV()](../Functions/Mathematical_functions.md#IDIV%28%29)\n* [IF()](../Functions/Arrays_and_conditions_functions.md#IF%28%29)\n* [IN()](../Functions/Arrays_and_conditions_functions.md#IN%28%29)\n* [INDEXOF()](../Functions/Arrays_and_conditions_functions.md#INDEXOF%28%29)\n* [INTEGER()](../Functions/Type_casting_functions.md#INTEGER%28%29)\n* [INTERVAL()](../Functions/Arrays_and_conditions_functions.md#INTERVAL%28%29)\n* [LAST_INSERT_ID()](../Functions/Other_functions.md#LAST_INSERT_ID%28%29)\n* [LEAST()](../Functions/Mathematical_functions.md#LEAST%28%29)\n* [LENGTH()](../Functions/Arrays_and_conditions_functions.md#LENGTH%28%29)\n* [LN()](../Functions/Mathematical_functions.md#LN%28%29)\n* [LOG10()](../Functions/Mathematical_functions.md#LOG10%28%29)\n* [LOG2()](../Functions/Mathematical_functions.md#LOG2%28%29)\n* [MAX()](../Functions/Mathematical_functions.md#MAX%28%29)\n* [MIN()](../Functions/Mathematical_functions.md#MIN%28%29)\n* [MINUTE()](../Functions/Date_and_time_functions.md#MINUTE%28%29)\n* [MIN_TOP_SORTVAL()](../Functions/Searching_and_ranking_functions.md#MIN_TOP_SORTVAL%28%29)\n* [MIN_TOP_WEIGHT()](../Functions/Searching_and_ranking_functions.md#MIN_TOP_WEIGHT%28%29)\n* [MONTH()](../Functions/Date_and_time_functions.md#MONTH%28%29)\n* [NOW()](../Functions/Date_and_time_functions.md#NOW%28%29)\n* [PACKEDFACTORS()](../Functions/Searching_and_ranking_functions.md#PACKEDFACTORS%28%29)\n* [POLY2D()](../Functions/Geo_spatial_functions.md#POLY2D%28%29)\n* [POW()](../Functions/Mathematical_functions.md#POW%28%29)\n* [RAND()](../Functions/Mathematical_functions.md#RAND%28%29)\n* [RANGE()](../Functions/Arrays_and_conditions_functions.md#RANGE%28%29)\n* [REGEX()](../Functions/String_functions.md#REGEX%28%29)\n* [REMAP()](../Functions/Arrays_and_conditions_functions.md#REMAP%28%29)\n* [SECOND()](../Functions/Date_and_time_functions.md#SECOND%28%29)\n* [SIN()](../Functions/Mathematical_functions.md#SIN%28%29)\n* [SINT()](../Functions/Type_casting_functions.md#SINT%28%29)\n* [SQRT()](../Functions/Mathematical_functions.md#SQRT%28%29)\n* [SUBSTRING_INDEX()](../Functions/String_functions.md#SUBSTRING_INDEX%28%29)\n* [TO_STRING()](../Functions/Type_casting_functions.md#TO_STRING%28%29)\n* [UINT()](../Functions/Type_casting_functions.md#UINT%28%29)\n* [YEAR()](../Functions/Date_and_time_functions.md#YEAR%28%29)\n* [YEARMONTH()](../Functions/Date_and_time_functions.md#YEARMONTH%28%29)\n* [YEARMONTHDAY()](../Functions/Date_and_time_functions.md#YEARMONTHDAY%28%29)\n* [WEIGHT()](../Functions/Searching_and_ranking_functions.md#WEIGHT%28%29)\n\n## Expressions in HTTP JSON\n\nIn the HTTP JSON interface, expressions are supported via `script_fields` and `expressions`.\n\n### script_fields\n\n<!-- example script_fields -->\n```json\n{\n\t\"table\": \"test\",\n\t\"query\": {\n\t\t\"match_all\": {}\n\t}, \"script_fields\": {\n\t\t\"add_all\": {\n\t\t\t\"script\": {\n\t\t\t\t\"inline\": \"( gid * 10 ) | crc32(title)\"\n\t\t\t}\n\t\t},\n\t\t\"title_len\": {\n\t\t\t\"script\": {\n\t \t\t\t\"inline\": \"crc32(title)\"\n\t\t\t}\n\t\t}\n\t}\n}\n```\n\nIn this example, two expressions are created: `add_all` and `title_len`. The first expression calculates `( gid * 10 ) | crc32(title)` and stores the result in the `add_all` attribute. The second expression calculates `crc32(title)` and stores the result in the `title_len` attribute.\n\nCurrently, only `inline` expressions are supported. The value of the `inline` property (the expression to compute) has the same syntax as SQL expressions.\n\nThe expression name can be utilized in filtering or sorting.\n\n\n<!-- intro -->\n##### script_fields:\n\n<!-- request script_fields -->\n```json\n{\n\t\"table\":\"movies_rt\",\n\t\"script_fields\":{\n\t\t\"cond1\":{\n\t\t\t\"script\":{\n\t\t\t\t\"inline\":\"actor_2_facebook_likes =296 OR movie_facebook_likes =37000\"\n\t\t\t}\n\t\t},\n\t\t\"cond2\":{\n\t\t\t\"script\":{\n\t\t\t\t\"inline\":\"IF (IN (content_rating,'TV-PG','PG'),2, IF(IN(content_rating,'TV-14','PG-13'),1,0))\"\n\t\t\t}\n\t\t}\n\t},\n\t\"limit\":10,\n\t\"sort\":[\n\t\t{\n\t\t\t\"cond2\":\"desc\"\n\t\t},\n\t\t{\n\t\t\t\"actor_1_name\":\"asc\"\n\t\t},\n\t\t{\n\t\t\t\"actor_2_name\":\"desc\"\n\t\t}\n\t],\n\t\"profile\":true,\n\t\"query\":{\n\t\t\"bool\":{\n\t\t\t\"must\":[\n\t\t\t\t{\n\t\t\t\t\t\"match\":{\n\t\t\t\t\t\t\"*\":\"star\"\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"equals\":{\n\t\t\t\t\t\t\"cond1\":1\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"must_not\":[\n\t\t\t\t{\n\t\t\t\t\t\"equals\":{\n\t\t\t\t\t\t\"content_rating\":\"R\"\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t}\n}\n```\n\n<!-- end -->\n\nBy default, expression values are included in the `_source` array of the result set. If the source is selective (see [Source selection](../Searching/Search_results.md#Source-selection)), the expression name can be added to the `_source` parameter in the request. Note, the names of the expressions must be in lowercase.\n\n### expressions\n\n<!-- example expressions -->\n\n`expressions` is an alternative to `script_fields` with a simpler syntax. The example request adds two expressions and stores the results into `add_all` and `title_len` attributes. Note, the names of the expressions must be in lowercase.\n\n<!-- request expressions -->\n```json\n{\n \"table\": \"test\",\n \"query\": { \"match_all\": {} },\n \"expressions\":\n {\n\t \"add_all\": \"( gid * 10 ) | crc32(title)\",\n \"title_len\": \"crc32(title)\"\n }\n}\n```\n\n<!-- end -->\n\n<!-- proofread -->\n\n",
  34. "updated_at": 1768530797,
  35. "source_md5": "f89c74fe818b4478e4775ac789f54990"
  36. }
  37. }