-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
NEST/Elasticsearch.Net version:
7.10.0
Elasticsearch version:
7.4.2
.NET runtime version:
5.0
Operating system version:
Description of the problem including expected versus actual behavior:
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?
Steps to reproduce:
1.
2.
3.
Expected behavior
A clear and concise description of what you expected to happen.
Provide ConnectionSettings (if relevant):
Provide DebugInformation (if relevant):
Metadata
Metadata
Assignees
Labels
No labels