public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer) { IFieldQuery fq = value as IFieldQuery; if (fq != null) { writer.WriteStartObject(); writer.WritePropertyName(fq.Field); writer.WriteStartObject(); if (fq is IValue) { IValue v = fq as IValue; writer.WritePropertyName("value"); writer.WriteValue(v.Value); } if (fq.Boost != 1.0) { writer.WritePropertyName("boost"); writer.WriteValue(fq.Boost); } writer.WriteEndObject(); writer.WriteEndObject(); } else { writer.WriteNull(); } }
protected InsertProxyBase(IFieldQuery fieldQuery) { FieldQuery = fieldQuery ?? throw new ArgumentNullException(nameof(fieldQuery)); }