< Summary

Class:Azure.Search.Documents.Indexes.Models.TextWeights
Assembly:Azure.Search.Documents
File(s):C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\TextWeights.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\TextWeights.Serialization.cs
C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\TextWeights.cs
Covered lines:0
Uncovered lines:23
Coverable lines:23
Total lines:92
Line coverage:0% (0 of 23)
Covered branches:0
Total branches:10
Branch coverage:0% (0 of 10)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeTextWeights(...)-0%0%
get_Weights()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\TextWeights.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Collections.Generic;
 10
 11namespace Azure.Search.Documents.Indexes.Models
 12{
 13    /// <summary> Defines weights on index fields for which matches should boost scoring in search queries. </summary>
 14    public partial class TextWeights
 15    {
 16        /// <summary> Initializes a new instance of TextWeights. </summary>
 17        /// <param name="weights"> The dictionary of per-field weights to boost document scoring. The keys are field nam
 18        /// <exception cref="ArgumentNullException"> <paramref name="weights"/> is null. </exception>
 019        public TextWeights(IDictionary<string, double> weights)
 20        {
 021            if (weights == null)
 22            {
 023                throw new ArgumentNullException(nameof(weights));
 24            }
 25
 026            Weights = weights;
 027        }
 28    }
 29}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\TextWeights.Serialization.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System.Collections.Generic;
 9using System.Text.Json;
 10using Azure.Core;
 11
 12namespace Azure.Search.Documents.Indexes.Models
 13{
 14    public partial class TextWeights : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            writer.WritePropertyName("weights");
 020            writer.WriteStartObject();
 021            foreach (var item in Weights)
 22            {
 023                writer.WritePropertyName(item.Key);
 024                writer.WriteNumberValue(item.Value);
 25            }
 026            writer.WriteEndObject();
 027            writer.WriteEndObject();
 028        }
 29
 30        internal static TextWeights DeserializeTextWeights(JsonElement element)
 31        {
 032            IDictionary<string, double> weights = default;
 033            foreach (var property in element.EnumerateObject())
 34            {
 035                if (property.NameEquals("weights"))
 36                {
 037                    Dictionary<string, double> dictionary = new Dictionary<string, double>();
 038                    foreach (var property0 in property.Value.EnumerateObject())
 39                    {
 040                        dictionary.Add(property0.Name, property0.Value.GetDouble());
 41                    }
 042                    weights = dictionary;
 43                    continue;
 44                }
 45            }
 046            return new TextWeights(weights);
 47        }
 48    }
 49}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\TextWeights.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4using System.Collections.Generic;
 5using Azure.Core;
 6
 7namespace Azure.Search.Documents.Indexes.Models
 8{
 9    public partial class TextWeights
 10    {
 11        /// <summary> The dictionary of per-field weights to boost document scoring. The keys are field names and the va
 012        public IDictionary<string, double> Weights { get; }
 13    }
 14}