_Script

Scripted queries

/ Script_score, / Script, / _Script, / Scripting

Scripted queries #

Scripts in the search request: script_score to compute the score, a script predicate in a boolean filter, and a _script sort key. All run on Pizza’s sandboxed script engine (see the script language reference) — Rhai, not Painless, but the doc['x'].value, _score, params.<name> spellings run unmodified.

script_score — score by script #

Wrap a query; the script’s value replaces the score. The script sees _score (the wrapped query’s BM25 score), doc (the hit’s _source in doc-values shape) and params:

...