According to the docs, one can write the following query:
{
"query": {
"function_score": {
"query": {
"match": { "message": "elasticsearch" }
},
"script_score": {
"script": {
"source": "Math.log(2 + doc['my-int'].value)"
}
}
}
}
}
However, the script_score key is not defined in the TypeScript types for function_score.
Your Environment
- node version: 15
@elastic/elasticsearch: 8.2.1