FirstRank

更新时间:
复制 MD 格式

A rough sort expression configured for a version of an OpenSearch application. FirstRank supports two expression types: a structured list of scoring functions (STRUCT) or a custom formula string (STRING).

Examples

STRUCT type — a structured expression using a built-in scoring function:

{
  "name": "default",
  "description": "",
  "active": true,
  "type": "STRUCT",
  "meta": [
    {
      "attribute": "static_bm25()",
      "arg": "",
      "weight": 10
    }
  ]
}

STRING type — a custom formula expression:

{
  "name": "my_demo",
  "description": "",
  "active": false,
  "type": "STRING",
  "meta": "random()*100+now()"
}

Structure

FieldTypeDescription
nameStringThe name of the expression.
descriptionStringThe description of the expression.
activeBooleanSpecifies whether this is the default rough sort expression.
typeStringThe type of the expression. Valid values: <br>- STRUCT: The expression is defined as a structured list of scoring functions. This is the default value. <br>- STRING: The expression is defined as a custom formula.
metaArray or StringThe content of the expression. The type depends on the type field: an array when type is STRUCT, or a string when type is STRING.

meta fields (when `type` is `STRUCT`)

FieldTypeDescription
[].attributeStringThe function used for score calculation or the field to search. For valid values, see Rough sort functions.
[].argStringThe parameters passed to the function. For valid values, see Rough sort functions.
[].weightNumberThe weight. Valid values: [-100000, 100000] (excluding 0).