public static void WriteFacetedQueryResult(this BlittableJsonTextWriter writer, JsonOperationContext context, FacetedQueryResult result) { writer.WriteStartObject(); writer.WritePropertyName(nameof(result.IndexName)); writer.WriteString(result.IndexName); writer.WriteComma(); writer.WritePropertyName(nameof(result.Results)); writer.WriteStartObject(); var isFirstInternal = true; foreach (var kvp in result.Results) { if (isFirstInternal == false) { writer.WriteComma(); } isFirstInternal = false; writer.WritePropertyName(kvp.Key); writer.WriteFacetResult(context, kvp.Value); } writer.WriteEndObject(); writer.WriteComma(); writer.WritePropertyName(nameof(result.IndexTimestamp)); writer.WriteString(result.IndexTimestamp.ToString(Default.DateTimeFormatsToWrite)); writer.WriteComma(); writer.WritePropertyName(nameof(result.LastQueryTime)); writer.WriteString(result.LastQueryTime.ToString(Default.DateTimeFormatsToWrite)); writer.WriteComma(); writer.WritePropertyName(nameof(result.IsStale)); writer.WriteBool(result.IsStale); writer.WriteComma(); writer.WritePropertyName(nameof(result.ResultEtag)); writer.WriteInteger(result.ResultEtag); writer.WriteEndObject(); }