boost.php
Table of Contents
Functions
- boost() : string
- Override the boost value of a search sub-expression.
Functions
boost()
Override the boost value of a search sub-expression.
boost(string $expr, float|int $boost) : string
Wraps the ArangoDB AQL function BOOST(expr, boost). The boost value is made
available to scorer functions (bm25(), tfidf()) so that matches
of the wrapped sub-expression weigh more (or less) in the final score. The
default boost of any search context is 1.0.
Example AQL usage:
ANALYZER(BOOST(doc.text == "foo", 2.5) OR doc.text == "bar", "text_en")
Parameters
- $expr : string
-
Any valid search expression (kept raw).
- $boost : float|int
-
Numeric boost value.
Tags
Return values
string —The formatted AQL expression.