I want to construct a query equivalent to the following JSON
{
"function_score": {
"script_score": {
"script": "doc['some-field'].value"
}
}
}
However, when I use the following code
var q = new FunctionScoreQuery
{
Query = new ScriptScoreQuery
{
Script = new InlineScript($"doc['some-field'].value"),
IsVerbatim = true,
},
IsVerbatim = true
};
It gets
{
"function_score": {
"query": {
"script_score": {
"script": "doc['some-field'].value"
}
}
}
}
which I post it to an ES instance and it gets error.
I checked FunctionScoreQuery and find nowhere to put the ScriptScoreQuery
. So how can I get what I want?