-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
NEST/Elasticsearch.Net version:
NEST 7.5.1
Elasticsearch version:
7.6.0
Description of the problem including expected versus actual behavior:
If no function is selected, then the JSON formatter will still add a comma after the field name:
elasticsearch-net/src/Nest/QueryDsl/Specialized/RankFeature/RankFeatureQuery.cs
Lines 189 to 206 in 453a608
writer.WritePropertyName("field"); | |
var fieldFormatter = formatterResolver.GetFormatter<Field>(); | |
fieldFormatter.Serialize(ref writer, value.Field, formatterResolver); | |
writer.WriteValueSeparator(); | |
switch (value.Function) | |
{ | |
case IRankFeatureSigmoidFunction sigmoid: | |
SerializeScoreFunction(ref writer, "sigmoid", sigmoid, formatterResolver); | |
break; | |
case IRankFeatureSaturationFunction saturation: | |
SerializeScoreFunction(ref writer, "saturation", saturation, formatterResolver); | |
break; | |
case IRankFeatureLogarithmFunction log: | |
SerializeScoreFunction(ref writer, "log", log, formatterResolver); | |
break; | |
} | |
writer.WriteEndObject(); |
Steps to reproduce:
- Create an index with a rank_feature field
- Add some docs to the index with field values
- Query for a single field without a Function parameter.
- Query generated will look like:
{"query":{"rank_feature":{"field":"field.prop",}}}
- note the extra comma.
Metadata
Metadata
Assignees
Labels
No labels