-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Description
The current ScriptQuery
implementation includes separate properties at the root level for properties of a script:
[JsonConverter(typeof(ScriptQueryConverter))] | |
[JsonObject(MemberSerialization = MemberSerialization.OptIn)] | |
public interface IScriptQuery : IQuery | |
{ | |
[JsonProperty("id")] | |
Id Id { get; set; } | |
[Obsolete("Use Source. Inline is deprecated and scheduled to be removed in Elasticsearch 7.0")] | |
[JsonIgnore] | |
string Inline { get; set; } | |
[JsonProperty("lang")] | |
string Lang { get; set; } | |
[JsonProperty("params")] | |
[JsonConverter(typeof(VerbatimDictionaryKeysJsonConverter<string, object>))] | |
Dictionary<string, object> Params { get; set; } | |
[JsonProperty("source")] | |
string Source { get; set; } | |
} |
This results in the need to have a custom JsonConverter
/serialization component in order to correctly nest these properties in JSON:
{
"script": {
"_name": "named_query",
"boost": 1.1,
"script": {
"source": "doc['numberOfCommits'].value > param1",
"params": {
"param1": 50
}
}
}
}
These properties should be removed and replaced with an IScript Script {get;set;}
property