< Summary

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

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
.ctor(...)-0%0%
.ctor(...)-0%0%
get_MaxTokenLength()-0%100%
Azure.Core.IUtf8JsonSerializable.Write(...)-0%0%
DeserializeLuceneStandardAnalyzer(...)-0%0%
get_Stopwords()-0%100%

File(s)

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\LuceneStandardAnalyzer.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;
 10using Azure.Core;
 11
 12namespace Azure.Search.Documents.Indexes.Models
 13{
 14    /// <summary> Standard Apache Lucene analyzer; Composed of the standard tokenizer, lowercase filter and stop filter.
 15    public partial class LuceneStandardAnalyzer : LexicalAnalyzer
 16    {
 17        /// <summary> Initializes a new instance of LuceneStandardAnalyzer. </summary>
 18        /// <param name="name"> The name of the analyzer. It must only contain letters, digits, spaces, dashes or unders
 19        /// <exception cref="ArgumentNullException"> <paramref name="name"/> is null. </exception>
 020        public LuceneStandardAnalyzer(string name) : base(name)
 21        {
 022            if (name == null)
 23            {
 024                throw new ArgumentNullException(nameof(name));
 25            }
 26
 027            Stopwords = new ChangeTrackingList<string>();
 028            ODataType = "#Microsoft.Azure.Search.StandardAnalyzer";
 029        }
 30
 31        /// <summary> Initializes a new instance of LuceneStandardAnalyzer. </summary>
 32        /// <param name="oDataType"> Identifies the concrete type of the analyzer. </param>
 33        /// <param name="name"> The name of the analyzer. It must only contain letters, digits, spaces, dashes or unders
 34        /// <param name="maxTokenLength"> The maximum token length. Default is 255. Tokens longer than the maximum lengt
 35        /// <param name="stopwords"> A list of stopwords. </param>
 036        internal LuceneStandardAnalyzer(string oDataType, string name, int? maxTokenLength, IList<string> stopwords) : b
 37        {
 038            MaxTokenLength = maxTokenLength;
 039            Stopwords = stopwords;
 040            ODataType = oDataType ?? "#Microsoft.Azure.Search.StandardAnalyzer";
 041        }
 42
 43        /// <summary> The maximum token length. Default is 255. Tokens longer than the maximum length are split. The max
 044        public int? MaxTokenLength { get; set; }
 45    }
 46}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Generated\Models\LuceneStandardAnalyzer.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 LuceneStandardAnalyzer : IUtf8JsonSerializable
 15    {
 16        void IUtf8JsonSerializable.Write(Utf8JsonWriter writer)
 17        {
 018            writer.WriteStartObject();
 019            if (Optional.IsDefined(MaxTokenLength))
 20            {
 021                writer.WritePropertyName("maxTokenLength");
 022                writer.WriteNumberValue(MaxTokenLength.Value);
 23            }
 024            if (Optional.IsCollectionDefined(Stopwords))
 25            {
 026                writer.WritePropertyName("stopwords");
 027                writer.WriteStartArray();
 028                foreach (var item in Stopwords)
 29                {
 030                    writer.WriteStringValue(item);
 31                }
 032                writer.WriteEndArray();
 33            }
 034            writer.WritePropertyName("@odata.type");
 035            writer.WriteStringValue(ODataType);
 036            writer.WritePropertyName("name");
 037            writer.WriteStringValue(Name);
 038            writer.WriteEndObject();
 039        }
 40
 41        internal static LuceneStandardAnalyzer DeserializeLuceneStandardAnalyzer(JsonElement element)
 42        {
 043            Optional<int> maxTokenLength = default;
 044            Optional<IList<string>> stopwords = default;
 045            string odataType = default;
 046            string name = default;
 047            foreach (var property in element.EnumerateObject())
 48            {
 049                if (property.NameEquals("maxTokenLength"))
 50                {
 051                    maxTokenLength = property.Value.GetInt32();
 052                    continue;
 53                }
 054                if (property.NameEquals("stopwords"))
 55                {
 056                    List<string> array = new List<string>();
 057                    foreach (var item in property.Value.EnumerateArray())
 58                    {
 059                        array.Add(item.GetString());
 60                    }
 061                    stopwords = array;
 062                    continue;
 63                }
 064                if (property.NameEquals("@odata.type"))
 65                {
 066                    odataType = property.Value.GetString();
 067                    continue;
 68                }
 069                if (property.NameEquals("name"))
 70                {
 071                    name = property.Value.GetString();
 72                    continue;
 73                }
 74            }
 075            return new LuceneStandardAnalyzer(odataType, name, Optional.ToNullable(maxTokenLength), Optional.ToList(stop
 76        }
 77    }
 78}

C:\Git\azure-sdk-for-net\sdk\search\Azure.Search.Documents\src\Indexes\Models\LuceneStandardAnalyzer.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 LuceneStandardAnalyzer
 10    {
 11        /// <summary> A list of stopwords. </summary>
 012        public IList<string> Stopwords { get; }
 13    }
 14}