< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%100%
.ctor(...)-0%100%
get_BoostingRangeStart()-0%100%
get_BoostingRangeEnd()-0%100%
get_ShouldBoostBeyondRangeByConstant()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeMagnitudeScoringParameters(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\MagnitudeScoringParameters.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
 8namespace Azure.Search.Documents.Indexes.Models
 9{
 10    /// <summary> Provides parameter values to a magnitude scoring function. </summary>
 11    public partial class MagnitudeScoringParameters
 12    {
 13        /// <summary> Initializes a new instance of MagnitudeScoringParameters. </summary>
 14        /// <param name="boostingRangeStart"> The field value at which boosting starts. </param>
 15        /// <param name="boostingRangeEnd"> The field value at which boosting ends. </param>
 016        public MagnitudeScoringParameters(double boostingRangeStart, double boostingRangeEnd)
 17        {
 018            BoostingRangeStart = boostingRangeStart;
 019            BoostingRangeEnd = boostingRangeEnd;
 020        }
 21
 22        /// <summary> Initializes a new instance of MagnitudeScoringParameters. </summary>
 23        /// <param name="boostingRangeStart"> The field value at which boosting starts. </param>
 24        /// <param name="boostingRangeEnd"> The field value at which boosting ends. </param>
 25        /// <param name="shouldBoostBeyondRangeByConstant"> A value indicating whether to apply a constant boost for fie
 026        internal MagnitudeScoringParameters(double boostingRangeStart, double boostingRangeEnd, bool? shouldBoostBeyondR
 27        {
 028            BoostingRangeStart = boostingRangeStart;
 029            BoostingRangeEnd = boostingRangeEnd;
 030            ShouldBoostBeyondRangeByConstant = shouldBoostBeyondRangeByConstant;
 031        }
 32
 33        /// <summary> The field value at which boosting starts. </summary>
 034        public double BoostingRangeStart { get; set; }
 35        /// <summary> The field value at which boosting ends. </summary>
 036        public double BoostingRangeEnd { get; set; }
 37        /// <summary> A value indicating whether to apply a constant boost for field values beyond the range end value; 
 038        public bool? ShouldBoostBeyondRangeByConstant { get; set; }
 39    }
 40}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\MagnitudeScoringParameters.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.Text.Json;
 9using Azure.Core;
 10
 11namespace Azure.Search.Documents.Indexes.Models
 12{
 13    public partial class MagnitudeScoringParameters : IUtf8JsonSerializable
 14    {
 15        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 16        {
 017            writer.WriteStartObject();
 018            writer.WritePropertyName("boostingRangeStart");
 019            writer.WriteNumberValue(BoostingRangeStart);
 020            writer.WritePropertyName("boostingRangeEnd");
 021            writer.WriteNumberValue(BoostingRangeEnd);
 022            if (Optional.IsDefined(ShouldBoostBeyondRangeByConstant))
 23            {
 024                writer.WritePropertyName("constantBoostBeyondRange");
 025                writer.WriteBooleanValue(ShouldBoostBeyondRangeByConstant.Value);
 26            }
 027            writer.WriteEndObject();
 028        }
 29
 30        internal static MagnitudeScoringParameters DeserializeMagnitudeScoringParameters(JsonElement element)
 31        {
 032            double boostingRangeStart = default;
 033            double boostingRangeEnd = default;
 034            Optional<bool> constantBoostBeyondRange = default;
 035            foreach (var property in element.EnumerateObject())
 36            {
 037                if (property.NameEquals("boostingRangeStart"))
 38                {
 039                    boostingRangeStart = property.Value.GetDouble();
 040                    continue;
 41                }
 042                if (property.NameEquals("boostingRangeEnd"))
 43                {
 044                    boostingRangeEnd = property.Value.GetDouble();
 045                    continue;
 46                }
 047                if (property.NameEquals("constantBoostBeyondRange"))
 48                {
 049                    constantBoostBeyondRange = property.Value.GetBoolean();
 50                    continue;
 51                }
 52            }
 053            return new MagnitudeScoringParameters(boostingRangeStart, boostingRangeEnd, Optional.ToNullable(constantBoos
 54        }
 55    }
 56}